File Coverage

blib/lib/Date/Holidays/Adapter/US.pm
Criterion Covered Total %
statement 18 27 66.6
branch n/a
condition n/a
subroutine 6 9 66.6
pod 3 3 100.0
total 27 39 69.2


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