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