File Coverage

lib/Date/Holidays/Adapter/FR.pm
Criterion Covered Total %
statement 19 27 70.3
branch 1 4 25.0
condition n/a
subroutine 6 7 85.7
pod 2 2 100.0
total 28 40 70.0


line stmt bran cond sub pod time code
1              
2             use strict;
3 1     1   414 use warnings;
  1         3  
  1         27  
4 1     1   4 use vars qw($VERSION);
  1         3  
  1         23  
5 1     1   5 use Carp;
  1         2  
  1         31  
6 1     1   5  
  1         2  
  1         56  
7             use base 'Date::Holidays::Adapter';
8 1     1   5  
  1         1  
  1         223  
9             $VERSION = '1.33';
10              
11             my ($self, %params) = @_;
12              
13 0     0 1 0 my $sub = $self->{_adaptee}->can('fr_holidays');
14              
15 0         0 if ($sub) {
16             return &{$sub}($params{'year'});
17 0 0       0 } else {
18 0         0 return;
  0         0  
19             }
20 0         0 }
21              
22             my ($self, %params) = @_;
23              
24             my $sub = $self->{_adaptee}->can('is_fr_holiday');
25 1     1 1 3  
26             if ($sub) {
27 1         8 return &{$sub}($params{'year'}, $params{'month'}, $params{'day'});
28             } else {
29 1 50       4 return;
30 0         0 }
  0         0  
31             }
32 1         3  
33             1;
34              
35              
36             =pod
37              
38             =encoding UTF-8
39              
40             =head1 NAME
41              
42             Date::Holidays::Adapter::FR - an adapter class for Date::Holidays::FR
43              
44             =head1 VERSION
45              
46             This POD describes version 1.33 of Date::Holidays::Adapter::FR
47              
48             =head1 DESCRIPTION
49              
50             The is the adapter class for L<Date::Holidays::FR>.
51              
52             =head1 SUBROUTINES/METHODS
53              
54             =head2 new
55              
56             The constructor is inherited from L<Date::Holidays::Adapter>
57              
58             =head2 new
59              
60             The constructor, takes a single named argument, B<countrycode>
61              
62             The constructor is inherited from L<Date::Holidays::Adapter>
63              
64             =head2 is_holiday
65              
66             The B<holidays> method, takes named 3 arguments, B<year>, B<month> and B<day>
67              
68             Returns an indication of whether the day is a holiday in the calendar of the
69             country referenced by B<countrycode> in the call to the constructor B<new>.
70              
71             =head2 holidays
72              
73             Not implemented in L<Date::Holidays::FR>, calls to this throw the
74             L<Date::Holidays::Exception::UnsupportedMethod>
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::FR>
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             B<holidays> or similar method is not implemented in L<Date::Holidays::FR> as
97             of version 0.02.
98              
99             Additional methods of L<Date::Holidays::FR> are not supported currently.
100              
101             Please refer to BUGS AND LIMITATIONS in L<Date::Holidays>
102              
103             =head1 BUG REPORTING
104              
105             Please refer to BUG REPORTING in L<Date::Holidays>
106              
107             =head1 AUTHOR
108              
109             Jonas Brømsø, (jonasbn) - C<< <jonasbn@cpan.org> >>
110              
111             =head1 LICENSE AND COPYRIGHT
112              
113             L<Date::Holidays> and related modules are (C) by Jonas Brømsø, (jonasbn)
114             2004-2022
115              
116             Date-Holidays and related modules are released under the Artistic License 2.0
117              
118             =cut