| 1 | package Date::Holidays::Adapter::JP; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use vars qw($VERSION); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use Locale::Country; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 1 | ▶ | use base 'Date::Holidays::Adapter'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 1 | $VERSION = '1.35'; | |||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | sub holidays { | ||||||||
|
Subroutine
holidays: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 14 | 0 | croak "holidays is unimplemented for ".__PACKAGE__; | |||||||||
| 15 | } | ||||||||||
| 16 | |||||||||||
| 17 | 0 | ▶ | sub is_holiday { | ||||||||
|
Subroutine
is_holiday: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 18 | 0 | my ($self, %params) = @_; | |||||||||
| 19 | |||||||||||
| 20 | 0 | my $sub = $self->{_adaptee}->can('is_japanese_holiday'); | |||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | if ($sub) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 0 | return &{$sub}($params{'year'}, $params{'month'}, $params{'day'}); | |||||||||
| 24 | } else { | ||||||||||
| 25 | 0 | return; | |||||||||
| 26 | } | ||||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | sub _fetch { | ||||||||
|
Subroutine
_fetch: not called CC=4 SCAR=30.0
| |||||||||||
| 30 | 0 | my ( $self, $params ) = @_; | |||||||||
| 31 | |||||||||||
| 32 | 0 | ▶ | if ( !$self->{_countrycode} ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | 0 | croak "No country code specified"; | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 0 | my $module = 'Date::Japanese::Holiday'; | |||||||||
| 37 | |||||||||||
| 38 | 0 | ▶ | if ( !$params->{nocheck} ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 39 | 0 | ▶ | if ( !code2country($self->{_countrycode}) ) { #from Locale::Country | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 0 | croak "$self->{_countrycode} is not a valid country code"; | |||||||||
| 41 | } | ||||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 0 | try { | |||||||||
| 45 | 0 | $self->_load($module); | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | return $module; | ||||||||||
| 49 | } | ||||||||||
| 50 | |||||||||||
| 51 | 1 | 1; | |||||||||
| 52 | |||||||||||
| 53 | __END__ | ||||||||||