File Coverage

lib/Date/Holidays/Adapter/BR.pm
Criterion Covered Total %
statement 14 22 63.6
branch 0 4 0.0
condition n/a
subroutine 5 6 83.3
pod 2 2 100.0
total 21 34 61.7


line stmt bran cond sub pod time code
1              
2             use strict;
3 1     1   410 use warnings;
  1         2  
  1         27  
4 1     1   5  
  1         1  
  1         23  
5             use base 'Date::Holidays::Adapter';
6 1     1   4  
  1         3  
  1         71  
7             use vars qw($VERSION);
8 1     1   7  
  1         2  
  1         187  
9             $VERSION = '1.33';
10              
11             my ( $self, %params ) = @_;
12              
13 0     0 1 0 my $dh = $self->{_adaptee}->new();
14              
15 0         0 if ($dh) {
16             return $dh->holidays( $params{'year'} );
17 0 0       0 } else {
18 0         0 return;
19             }
20 0         0 }
21              
22             my ( $self, %params ) = @_;
23              
24             my $dh = $self->{_adaptee}->new();
25 1     1 1 3  
26             if ($dh) {
27 1         3 return $dh->is_holiday( $params{'year'}, $params{'month'},
28             $params{'day'} );
29 0 0         } else {
30             return '';
31 0           }
32             }
33 0            
34             1;
35              
36              
37             =pod
38              
39             =encoding UTF-8
40              
41             =head1 NAME
42              
43             Date::Holidays::Adapter::BR - an adapter class for Date::Holidays::BR
44              
45             =head1 VERSION
46              
47             This POD describes version 1.33 of Date::Holidays::Adapter::BR
48              
49             =head1 DESCRIPTION
50              
51             The is the adapter class for L<Date::Holidays::BR>.
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             The B<holidays> method, takes a single named argument, B<year>
69              
70             Returns a reference to a hash holding the calendar of the country referenced by
71             B<countrycode> in the call to the constructor B<new>.
72              
73             The calendar will spand for a year and the keys consist of B<month> and B<day>
74             concatenated.
75              
76             =head1 DIAGNOSTICS
77              
78             Please refer to DIAGNOSTICS in L<Date::Holidays>
79              
80             =head1 DEPENDENCIES
81              
82             =over
83              
84             =item * L<Date::Holidays::PT>
85              
86             =item * L<Date::Holidays::Adapter>
87              
88             =back
89              
90             =head1 INCOMPATIBILITIES
91              
92             Please refer to INCOMPATIBILITIES in L<Date::Holidays>
93              
94             =head1 BUGS AND LIMITATIONS
95              
96             Please refer to INCOMPATIBILITIES in L<Date::Holidays>
97              
98             =head1 BUG REPORTING
99              
100             Please refer to BUG REPORTING in L<Date::Holidays>
101              
102             =head1 AUTHOR
103              
104             Jonas Brømsø, (jonasbn) - C<< <jonasbn@cpan.org> >>
105              
106             =head1 LICENSE AND COPYRIGHT
107              
108             L<Date::Holidays> and related modules are (C) by Jonas Brømsø, (jonasbn)
109             2004-2022
110              
111             Date-Holidays and related modules are released under the Artistic License 2.0
112              
113             =cut