File Coverage

blib/lib/Date/Holidays/Adapter/SK.pm
Criterion Covered Total %
statement 12 25 48.0
branch 0 4 0.0
condition n/a
subroutine 4 6 66.6
pod 2 2 100.0
total 18 37 48.6


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