File Coverage

blib/lib/Date/Holidays/Adapter/NO.pm
Criterion Covered Total %
statement 12 24 50.0
branch 0 4 0.0
condition n/a
subroutine 4 6 66.6
pod 2 2 100.0
total 18 36 50.0


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