File Coverage

blib/lib/Date/Holidays/GB/NIR.pm
Criterion Covered Total %
statement 12 16 75.0
branch 0 4 0.0
condition n/a
subroutine 4 6 66.6
pod 0 2 0.0
total 16 28 57.1


line stmt bran cond sub pod time code
1             package Date::Holidays::GB::NIR;
2              
3             our $VERSION = '0.023'; # VERSION
4              
5 1     1   492 use strict;
  1         3  
  1         29  
6 1     1   5 use warnings;
  1         2  
  1         34  
7              
8 1     1   7 use Date::Holidays::GB;
  1         4  
  1         36  
9              
10 1     1   5 use base qw( Exporter );
  1         8  
  1         223  
11             our @EXPORT_OK = qw(
12             holidays
13             is_holiday
14             );
15              
16             sub holidays {
17 0 0   0 0   my %args
18             = $_[0] =~ m/\D/
19             ? @_
20             : ( year => $_[0] );
21              
22 0           return Date::Holidays::GB::holidays( %args, regions => [ 'NIR' ] );
23             }
24              
25             sub is_holiday {
26 0 0   0 0   my %args
27             = $_[0] =~ m/\D/
28             ? @_
29             : ( year => $_[0], month => $_[1], day => $_[2] );
30              
31 0           return Date::Holidays::GB::is_holiday( %args, regions => [ 'NIR' ] );
32             }
33              
34             1;
35              
36             __END__
37              
38             =head1 NAME
39              
40             Date::Holidays::GB::NIR - Date::Holidays class for GB-NIR (Northern Ireland)
41              
42             =head1 SYNOPSIS
43              
44             use Date::Holidays::GB::NIR qw( holidays is_holiday );
45              
46             # All holidays for Northern Ireland
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