File Coverage

blib/lib/Date/Holidays/Adapter/AW.pm
Criterion Covered Total %
statement 12 30 40.0
branch 0 4 0.0
condition n/a
subroutine 4 6 66.6
pod 2 2 100.0
total 18 42 42.8


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