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