File Coverage

blib/lib/Date/Holidays/Adapter/KZ.pm
Criterion Covered Total %
statement 12 26 46.1
branch 0 4 0.0
condition n/a
subroutine 4 6 66.6
pod 2 2 100.0
total 18 38 47.3


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