File Coverage

blib/lib/Date/Holidays/Adapter/USFederal.pm
Criterion Covered Total %
statement 18 22 81.8
branch n/a
condition n/a
subroutine 6 8 75.0
pod 2 2 100.0
total 26 32 81.2


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