File Coverage

blib/lib/Date/Holidays/GB/EAW.pm
Criterion Covered Total %
statement 16 16 100.0
branch 2 4 50.0
condition n/a
subroutine 6 6 100.0
pod 0 2 0.0
total 24 28 85.7


line stmt bran cond sub pod time code
1             package Date::Holidays::GB::EAW;
2              
3             our $VERSION = '0.021'; our $VERSION = '0.022'; # VERSION
4              
5 2     2   1230 use strict;
  2         5  
  2         73  
6 2     2   11 use warnings;
  2         4  
  2         57  
7              
8 2     2   16 use Date::Holidays::GB;
  2         8  
  2         85  
9              
10 2     2   22 use base qw( Exporter );
  2         4  
  2         503  
11             our @EXPORT_OK = qw(
12             holidays
13             is_holiday
14             );
15              
16             sub holidays {
17 1 50   1 0 19 my %args
18             = $_[0] =~ m/\D/
19             ? @_
20             : ( year => $_[0] );
21              
22 1         18 return Date::Holidays::GB::holidays( %args, regions => [ 'EAW' ] );
23             }
24              
25             sub is_holiday {
26 5 50   5 0 1631 my %args
27             = $_[0] =~ m/\D/
28             ? @_
29             : ( year => $_[0], month => $_[1], day => $_[2] );
30              
31 5         32 return Date::Holidays::GB::is_holiday( %args, regions => [ 'EAW' ] );
32             }
33              
34             1;
35              
36             __END__
37              
38             =head1 NAME
39              
40             Date::Holidays::GB::EAW - Date::Holidays class for GB-EAW (England & Wales)
41              
42             =head1 SYNOPSIS
43              
44             use Date::Holidays::GB::EAW qw( holidays is_holiday );
45              
46             # All holidays for England & Wales
47             my $holidays = holidays( year => 2013 );
48              
49             if ( is_holiday( year => 2013, month => 12, day => 25 ) ) {
50             print "No work today!";
51             }
52              
53             =cut
54