File Coverage

lib/Date/Holidays/Adapter/SK.pm
Criterion Covered Total %
statement 17 25 68.0
branch 1 4 25.0
condition n/a
subroutine 5 6 83.3
pod 2 2 100.0
total 25 37 67.5


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