line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use strict; |
3
|
1
|
|
|
1
|
|
433
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
4
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
5
|
|
|
|
|
|
|
use base 'Date::Holidays::Adapter'; |
6
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
61
|
|
7
|
|
|
|
|
|
|
use vars qw($VERSION); |
8
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
170
|
|
9
|
|
|
|
|
|
|
$VERSION = '1.33'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my ($self, %params) = @_; |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
0
|
1
|
0
|
my $dh = $self->{_adaptee}->new(); |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
0
|
if ($dh) { |
16
|
|
|
|
|
|
|
return $dh->holidays($params{'year'}); |
17
|
0
|
0
|
|
|
|
0
|
} else { |
18
|
0
|
|
|
|
|
0
|
return; |
19
|
|
|
|
|
|
|
} |
20
|
0
|
|
|
|
|
0
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my ($self, %params) = @_; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my $dh = $self->{_adaptee}->new(); |
25
|
1
|
|
|
1
|
1
|
3
|
|
26
|
|
|
|
|
|
|
if ($dh) { |
27
|
1
|
|
|
|
|
4
|
return $dh->is_holiday($params{'year'}, $params{'month'}, $params{'day'}); |
28
|
|
|
|
|
|
|
} else { |
29
|
0
|
0
|
|
|
|
|
return ''; |
30
|
0
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
0
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=pod |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=encoding UTF-8 |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Date::Holidays::Adapter::PT - an adapter class for Date::Holidays::PT |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 VERSION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
This POD describes version 1.33 of Date::Holidays::Adapter::PT |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 DESCRIPTION |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
The is the adapter class for L<Date::Holidays::PT>. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 new |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
The constructor, takes a single named argument, B<countrycode> |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 is_holiday |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
The B<holidays> method, takes 3 named arguments, B<year>, B<month> and B<day> |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Returns an indication of whether the day is a holiday in the calendar of the |
63
|
|
|
|
|
|
|
country referenced by B<countrycode> in the call to the constructor B<new>. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 holidays |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
The B<holidays> method, takes a single named argument, B<year> |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Returns a reference to a hash holding the calendar of the country referenced by |
70
|
|
|
|
|
|
|
B<countrycode> in the call to the constructor B<new>. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
The calendar will spand for a year and the keys consist of B<month> and B<day> |
73
|
|
|
|
|
|
|
concatenated. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 DIAGNOSTICS |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Please refer to DIAGNOSTICS in L<Date::Holidays> |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=over |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item * L<Date::Holidays::PT> |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=item * L<Date::Holidays::Adapter> |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=back |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 INCOMPATIBILITIES |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Please refer to INCOMPATIBILITIES in L<Date::Holidays> |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
The adapter does not implement the B<is_pt_holiday> method. The pattern used is |
96
|
|
|
|
|
|
|
an object adapter pattern and inheritance is therefor not used, it is my hope |
97
|
|
|
|
|
|
|
that I can make this work with some Perl magic. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 BUG REPORTING |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Please refer to BUG REPORTING in L<Date::Holidays> |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 AUTHOR |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Jonas Brømsø, (jonasbn) - C<< <jonasbn@cpan.org> >> |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
L<Date::Holidays> and related modules are (C) by Jonas Brømsø, (jonasbn) |
110
|
|
|
|
|
|
|
2004-2022 |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Date-Holidays and related modules are released under the Artistic License 2.0 |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=cut |