File Coverage

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