File Coverage

lib/Date/Holidays/Adapter/US.pm
Criterion Covered Total %
statement 26 27 96.3
branch n/a
condition n/a
subroutine 8 9 88.8
pod 3 3 100.0
total 37 39 94.8


line stmt bran cond sub pod time code
1              
2             use strict;
3 1     1   407 use warnings;
  1         2  
  1         27  
4 1     1   4 use vars qw($VERSION);
  1         2  
  1         24  
5 1     1   4 use Carp; # croak
  1         2  
  1         31  
6 1     1   5 use Data::Dumper;
  1         1  
  1         80  
7 1     1   644  
  1         6385  
  1         53  
8             use base 'Date::Holidays::Adapter';
9 1     1   7  
  1         2  
  1         170  
10             $VERSION = '1.33';
11              
12             my ( $class, %params ) = @_;
13              
14 1     1 1 4 $params{countrycode} = 'USFederal';
15             $params{nocheck} = 1;
16 1         2  
17 1         2 my $self = $class->SUPER::new(%params);
18             return $self;
19 1         6 }
20 1         4  
21              
22             croak "holidays is unimplemented for ".__PACKAGE__;
23             }
24              
25 0     0 1 0 my ($self, %params) = @_;
26              
27             $self->_load($self->{_adaptee});
28              
29 1     1 1 3 return Date::Holidays::USFederal::is_usfed_holiday(
30             $params{'year'}, $params{'month'}, $params{'day'}
31 1         3 );
32             }
33              
34 1         23 1;
35              
36              
37             =pod
38              
39             =encoding UTF-8
40              
41             =head1 NAME
42              
43             Date::Holidays::Adapter::US - an adapter class for Date::Holidays::USFederal
44              
45             =head1 VERSION
46              
47             This POD describes version 1.33 of Date::Holidays::Adapter::US
48              
49             =head1 DESCRIPTION
50              
51             The is the adapter class for L<Date::Holidays::USFederal>.
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             Not supported by L<Date::Holidays::USFederal>
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::USFederal>
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