File Coverage

blib/lib/Date/Holidays/Adapter/AU.pm
Criterion Covered Total %
statement 15 29 51.7
branch 0 8 0.0
condition n/a
subroutine 5 7 71.4
pod 2 2 100.0
total 22 46 47.8


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