File Coverage

blib/lib/Date/Holidays/Adapter/BR.pm
Criterion Covered Total %
statement 12 22 54.5
branch 0 4 0.0
condition n/a
subroutine 4 6 66.6
pod 2 2 100.0
total 18 34 52.9


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