| 1 | package DateTime::Format::Natural::Lang::Base; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 27 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 27 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 27 | our ($VERSION, $AUTOLOAD); | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 27 | $VERSION = '1.09'; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | sub __new | ||||||||||||||||||||||||||||
| 11 | 10886 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
__new: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 10886 | my $class = shift; | |||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 27 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 10886 | my $obj = {}; | |||||||||||||||||||||||||||
| 17 | 10886 | $obj->{weekdays} = \%{"${class}::data_weekdays"}; | |||||||||||||||||||||||||||
| 18 | 10886 | $obj->{weekdays_abbrev} = \%{"${class}::data_weekdays_abbrev"}; | |||||||||||||||||||||||||||
| 19 | 10886 | $obj->{weekdays_all} = \@{"${class}::data_weekdays_all"}; | |||||||||||||||||||||||||||
| 20 | 10886 | $obj->{months} = \%{"${class}::data_months"}; | |||||||||||||||||||||||||||
| 21 | 10886 | $obj->{months_abbrev} = \%{"${class}::data_months_abbrev"}; | |||||||||||||||||||||||||||
| 22 | 10886 | $obj->{months_all} = \@{"${class}::data_months_all"}; | |||||||||||||||||||||||||||
| 23 | 10886 | $obj->{conversion} = \%{"${class}::data_conversion"}; | |||||||||||||||||||||||||||
| 24 | 10886 | $obj->{helpers} = \%{"${class}::data_helpers"}; | |||||||||||||||||||||||||||
| 25 | 10886 | $obj->{duration} = \%{"${class}::data_duration"}; | |||||||||||||||||||||||||||
| 26 | 10886 | $obj->{aliases} = \%{"${class}::data_aliases"}; | |||||||||||||||||||||||||||
| 27 | 10886 | $obj->{rewrite} = \%{"${class}::data_rewrite"}; | |||||||||||||||||||||||||||
| 28 | 10886 | $obj->{holidays} = \%{"${class}::data_holidays"}; | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 10886 | return bless $obj, $class; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | AUTOLOAD | ||||||||||||||||||||||||||||
| 34 | 1879752 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||
| 35 | 1879752 | my ($self, $exp) = @_; | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 1879752 | my ($caller, $sub) = $AUTOLOAD =~ /^(.+)::(.+)$/; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 1879752 | ▶ | if (substr($sub, 0, 2) eq '__') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 40 | 1868866 | $sub =~ s/^__//; | |||||||||||||||||||||||||||
| 41 | 27 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 42 | 1868866 | ▶ | if (defined $exp && length $exp) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $exp and length $exp
MC/DC50%1/2
defined $exp and length $exp
defined $exp
length $exp
Truth table66%2/3
A and B
A= defined $expB= length $exp
| |||||||||||||||||||||||||||||
| 43 | 1857960 | return ${$caller.'::'.$sub}{$exp}; | |||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | else { | ||||||||||||||||||||||||||||
| 46 | 10906 | return \%{$caller.'::'.$sub}; | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 27 | 1; | |||||||||||||||||||||||||||
| 52 | __END__ | ||||||||||||||||||||||||||||