File Coverage

lib/Date/Holidays/Adapter/PL.pm
Criterion Covered Total %
statement 19 22 86.3
branch 1 2 50.0
condition n/a
subroutine 6 7 85.7
pod 2 2 100.0
total 28 33 84.8


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