line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
## Stripe API - ~/lib/Net/API/Stripe/TimeZone.pm |
3
|
|
|
|
|
|
|
## Version v0.100.0 |
4
|
|
|
|
|
|
|
## Copyright(c) 2019 DEGUEST Pte. Ltd. |
5
|
|
|
|
|
|
|
## Author: Jacques Deguest <jack@deguest.jp> |
6
|
|
|
|
|
|
|
## Created 2019/11/02 |
7
|
|
|
|
|
|
|
## Modified 2020/05/15 |
8
|
|
|
|
|
|
|
## |
9
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
10
|
|
|
|
|
|
|
BEGIN |
11
|
|
|
|
|
|
|
{ |
12
|
|
|
|
|
|
|
use strict; |
13
|
1
|
|
|
1
|
|
972
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
14
|
1
|
|
|
1
|
|
8
|
use vars qw( $VERSION ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
15
|
1
|
|
|
1
|
|
7
|
use parent qw( Module::Generic ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
45
|
|
16
|
1
|
|
|
1
|
|
6
|
use DateTime::TimeZone; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
17
|
1
|
|
|
1
|
|
64
|
use Nice::Try; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
18
|
1
|
|
|
1
|
|
7
|
use overload ('""' => 'name', |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
19
|
|
|
|
|
|
|
'==' => sub { _obj_eq(@_) }, |
20
|
0
|
|
|
0
|
|
0
|
'!=' => sub { !_obj_eq(@_) }, |
21
|
0
|
|
|
0
|
|
0
|
fallback => 1, |
22
|
1
|
|
|
|
|
14
|
); |
23
|
1
|
|
|
1
|
|
97914
|
our( $VERSION ) = 'v0.100.0'; |
|
1
|
|
|
|
|
2
|
|
24
|
1
|
|
|
1
|
|
151
|
}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
use strict; |
27
|
1
|
|
|
1
|
|
22
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
28
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1093
|
|
29
|
|
|
|
|
|
|
{ |
30
|
|
|
|
|
|
|
my $self = shift( @_ ); |
31
|
|
|
|
|
|
|
my $init = shift( @_ ); |
32
|
0
|
|
|
0
|
1
|
|
my $value = shift( @_ ); |
33
|
0
|
|
|
|
|
|
my $tz; |
34
|
0
|
|
|
|
|
|
try |
35
|
0
|
|
|
|
|
|
{ |
36
|
0
|
0
|
0
|
|
|
|
$tz = DateTime::TimeZone->new( name => $value, @_ ); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
37
|
0
|
|
|
0
|
|
|
} |
38
|
0
|
|
|
|
|
|
catch( $e ) |
39
|
|
|
|
|
|
|
{ |
40
|
0
|
0
|
0
|
|
|
|
return( $self->error( "Invalid time zone '${tz}': $e" ) ); |
|
0
|
0
|
0
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
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|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
} |
45
|
0
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
{ |
48
|
0
|
|
|
0
|
1
|
|
# return overload::StrVal( $_[0] ) eq overload::StrVal( $_[1] ); |
49
|
|
|
|
|
|
|
no overloading; |
50
|
|
|
|
|
|
|
my $self = shift( @_ ); |
51
|
|
|
|
|
|
|
my $other = shift( @_ ); |
52
|
|
|
|
|
|
|
return( 0 ) if( !ref( $other ) || !$other->isa( 'Net::API::Stripe::TimeZone' ) ); |
53
|
1
|
|
|
1
|
|
8
|
my $name = $self->{tz}->name; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
90
|
|
54
|
0
|
|
|
0
|
|
|
my $name2 = $other->{tz}->name; |
55
|
0
|
|
|
|
|
|
return( 0 ) if( $name ne $name2 ); |
56
|
0
|
0
|
0
|
|
|
|
use overloading; |
57
|
0
|
|
|
|
|
|
return( 1 ); |
58
|
0
|
|
|
|
|
|
} |
59
|
0
|
0
|
|
|
|
|
|
60
|
1
|
|
|
1
|
|
6
|
AUTOLOAD |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
150
|
|
61
|
0
|
|
|
|
|
|
{ |
62
|
|
|
|
|
|
|
my( $method ) = our $AUTOLOAD =~ /([^:]+)$/; |
63
|
|
|
|
|
|
|
my $self = shift( @_ ); |
64
|
|
|
|
|
|
|
return( $self->{tz}->$method( @_ ) ); |
65
|
|
|
|
|
|
|
}; |
66
|
0
|
|
|
0
|
|
|
|
67
|
0
|
|
|
|
|
|
DESTROY {}; |
68
|
0
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
# NOTE: POD |
71
|
|
|
|
0
|
|
|
|
72
|
|
|
|
|
|
|
=encoding utf8 |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 NAME |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Net::API::Stripe::TimeZone - A Time Zone Object |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 SYNOPSIS |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
# or one can pass just 'local' just like for DateTime::TineZone |
81
|
|
|
|
|
|
|
my $tz = $stripe->account->settings->dashboard->timezone( 'Asia/Tokyo' ); |
82
|
|
|
|
|
|
|
print( $tz->name, "\n" ); |
83
|
|
|
|
|
|
|
# Asia/Tokyo |
84
|
|
|
|
|
|
|
print( "Time zone is $tz\n" ); |
85
|
|
|
|
|
|
|
# produces: Time zone is Asia/Tokyo |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
my $tz2 = $stripe->account->settings->dashboard->timezone( 'local' ); |
88
|
|
|
|
|
|
|
print( "$tz is same as $tz2? ", $tz eq $tz2 ? 'yes' : 'no', "\n" ); |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 VERSION |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
v0.100.0 |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 DESCRIPTION |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
This is a wrapper around L<DateTime::TimeZone> to provide stringification. L<Net::API::Stripe::TimeZone> does not inherit from L<DateTime::TimeZone> but all method of L<DateTime::TimeZone> are accessible via the module B<AUTOLOAD> |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head2 new( hash init, timezone ) |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Creates a new L<Net::API::Stripe::TimeZone> object. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 METHODS |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head2 name |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
This is read only. It returns the current value of the time zone. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
For all other methods, see the manual page of L<DateTime::TimeZone> |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 HISTORY |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head2 v0.1 |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Initial version |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 AUTHOR |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 SEE ALSO |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Stripe API documentation: |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
L<DateTime::TimeZone> |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Copyright (c) 2019-2020 DEGUEST Pte. Ltd. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
You can use, copy, modify and redistribute this package and associated |
133
|
|
|
|
|
|
|
files under the same terms as Perl itself. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=cut |