| 1 | package Text::APL::Context; | ||||||||||||
| 2 | |||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 3 | ▶ | use base 'Text::APL::Base'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 3 | ▶ | use Digest::MD5 (); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | sub _BUILD { | ||||||||||||
| 11 | 26 | ▶ | my $self = shift; | ||||||||||
|
Subroutine
_BUILD: called CC=3 SCAR=11.0
| |||||||||||||
| 12 | |||||||||||||
| 13 | 26 | ▶ | $self->{vars} ||= {}; | ||||||||||
|
Condition100%2/2
$self->{"vars"} ||= {}
MC/DC100%1/1
$self->{"vars"} ||= {}
$self->{"vars"}
Truth table100%2/2
A
A= $self->{"vars"}
| |||||||||||||
| 14 | 26 | ▶ | $self->{helpers} ||= {}; | ||||||||||
|
Condition100%2/2
$self->{"helpers"} ||= {}
MC/DC100%1/1
$self->{"helpers"} ||= {}
$self->{"helpers"}
Truth table100%2/2
A
A= $self->{"helpers"}
| |||||||||||||
| 15 | } | ||||||||||||
| 16 | |||||||||||||
| 17 | sub id { | ||||||||||||
| 18 | 28 | ▶ | my $self = shift; | ||||||||||
|
Subroutine
id: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 19 | |||||||||||||
| 20 | 28 | my $id = ''; | |||||||||||
| 21 | |||||||||||||
| 22 | 28 | $id .= join ':', sort keys %{$self->{vars}}; | |||||||||||
| 23 | 28 | $id .= ','; | |||||||||||
| 24 | 28 | $id .= join ':', sort keys %{$self->{helpers}}; | |||||||||||
| 25 | |||||||||||||
| 26 | 28 | return Digest::MD5::md5_hex($id); | |||||||||||
| 27 | } | ||||||||||||
| 28 | |||||||||||||
| 29 | 31 | ▶ | sub name { $_[0]->{name} || '' } | ||||||||||
|
Subroutine
name: called CC=2 SCAR=6.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||
| 30 | 35 | ▶ | sub vars { $_[0]->{vars} } | ||||||||||
|
Subroutine
vars: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 31 | 64 | ▶ | sub helpers { $_[0]->{helpers} } | ||||||||||
|
Subroutine
helpers: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 32 | |||||||||||||
| 33 | sub add_helper { | ||||||||||||
| 34 | 45 | ▶ | my $self = shift; | ||||||||||
|
Subroutine
add_helper: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 35 | |||||||||||||
| 36 | 45 | $self->add('helpers', @_); | |||||||||||
| 37 | } | ||||||||||||
| 38 | |||||||||||||
| 39 | sub add_var { | ||||||||||||
| 40 | 1 | ▶ | my $self = shift; | ||||||||||
|
Subroutine
add_var: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 41 | |||||||||||||
| 42 | 1 | $self->add('vars', @_); | |||||||||||
| 43 | } | ||||||||||||
| 44 | |||||||||||||
| 45 | sub add { | ||||||||||||
| 46 | 46 | ▶ | my $self = shift; | ||||||||||
|
Subroutine
add: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 47 | 46 | my ($type, $key, $value) = @_; | |||||||||||
| 48 | |||||||||||||
| 49 | 46 | $self->{$type}->{$key} = $value; | |||||||||||
| 50 | } | ||||||||||||
| 51 | |||||||||||||
| 52 | 3 | 1; | |||||||||||
| 53 | __END__ | ||||||||||||