File Coverage

blib/lib/Date/Holidays/Adapter/FR.pm
Criterion Covered Total %
statement 15 27 55.5
branch 0 4 0.0
condition n/a
subroutine 5 7 71.4
pod 2 2 100.0
total 22 40 55.0


line stmt bran cond sub pod time code
1             package Date::Holidays::Adapter::FR;
2              
3 1     1   255539 use strict;
  1         3  
  1         46  
4 1     1   6 use warnings;
  1         2  
  1         80  
5 1     1   6 use vars qw($VERSION);
  1         2  
  1         54  
6 1     1   5 use Carp;
  1         2  
  1         115  
7              
8 1     1   9 use base 'Date::Holidays::Adapter';
  1         2  
  1         657  
9              
10             $VERSION = '1.35';
11              
12             sub holidays {
13 0     0 1   my ($self, %params) = @_;
14              
15 0           my $sub = $self->{_adaptee}->can('fr_holidays');
16              
17 0 0         if ($sub) {
18 0           return &{$sub}($params{'year'});
  0            
19             } else {
20 0           return;
21             }
22             }
23              
24             sub is_holiday {
25 0     0 1   my ($self, %params) = @_;
26              
27 0           my $sub = $self->{_adaptee}->can('is_fr_holiday');
28              
29 0 0         if ($sub) {
30 0           return &{$sub}($params{'year'}, $params{'month'}, $params{'day'});
  0            
31             } else {
32 0           return;
33             }
34             }
35              
36             1;
37              
38             __END__
39              
40             =pod
41              
42             =encoding UTF-8
43              
44             =head1 NAME
45              
46             Date::Holidays::Adapter::FR - an adapter class for Date::Holidays::FR
47              
48             =head1 VERSION
49              
50             This POD describes version 1.35 of Date::Holidays::Adapter::FR
51              
52             =head1 DESCRIPTION
53              
54             The is the adapter class for L<Date::Holidays::FR>.
55              
56             =head1 SUBROUTINES/METHODS
57              
58             =head2 new
59              
60             The constructor is inherited from L<Date::Holidays::Adapter>
61              
62             =head2 new
63              
64             The constructor, takes a single named argument, B<countrycode>
65              
66             The constructor is inherited from L<Date::Holidays::Adapter>
67              
68             =head2 is_holiday
69              
70             The B<holidays> method, takes named 3 arguments, B<year>, B<month> and B<day>
71              
72             Returns an indication of whether the day is a holiday in the calendar of the
73             country referenced by B<countrycode> in the call to the constructor B<new>.
74              
75             =head2 holidays
76              
77             Not implemented in L<Date::Holidays::FR>, calls to this throw the
78             L<Date::Holidays::Exception::UnsupportedMethod>
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::FR>
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             B<holidays> or similar method is not implemented in L<Date::Holidays::FR> as
101             of version 0.02.
102              
103             Additional methods of L<Date::Holidays::FR> are not supported currently.
104              
105             Please refer to BUGS AND LIMITATIONS in L<Date::Holidays>
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