File Coverage

lib/Date/Holidays/Adapter/NO.pm
Criterion Covered Total %
statement 17 24 70.8
branch 1 4 25.0
condition n/a
subroutine 5 6 83.3
pod 2 2 100.0
total 25 36 69.4


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