| 1 | package Geoffrey::Changeset; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use 5.016; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 3 | ▶ | use Geoffrey::Utils; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 3 | $Geoffrey::Changeset::VERSION = '0.000206'; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 3 | ▶ | use parent 'Geoffrey::Role::Core'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 36 | ▶ | sub action { | ||||||||||||||||||||||||||
|
Subroutine
action: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 14 | 36 | my ( $self, $s_action ) = @_; | |||||||||||||||||||||||||||
| 15 | 36 | return Geoffrey::Utils::action_obj_from_name( | |||||||||||||||||||||||||||
| 16 | $s_action, | ||||||||||||||||||||||||||||
| 17 | dbh => $self->dbh, | ||||||||||||||||||||||||||||
| 18 | converter => $self->converter, | ||||||||||||||||||||||||||||
| 19 | template => $self->template, | ||||||||||||||||||||||||||||
| 20 | ); | ||||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 3 | ▶ | sub postfix { | ||||||||||||||||||||||||||
|
Subroutine
postfix: called CC=3 SCAR=13.1
Pod
documented
| |||||||||||||||||||||||||||||
| 24 | 3 | ▶ | return $_[0]->{postfix} // q~~ if !defined $_[1]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$_[0]{"postfix"} // ""
MC/DC0%0/1
$_[0]{"postfix"} // ""
$_[0]{"postfix"}
Truth table0%0/2
A
A= $_[0]{"postfix"}
| |||||||||||||||||||||||||||||
| 25 | 3 | $_[0]->{postfix} = $_[1]; | |||||||||||||||||||||||||||
| 26 | 3 | return $_[0]->{postfix}; | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 3 | ▶ | sub prefix { | ||||||||||||||||||||||||||
|
Subroutine
prefix: called CC=3 SCAR=13.1
Pod
documented
| |||||||||||||||||||||||||||||
| 30 | 3 | ▶ | return $_[0]->{prefix} // q~~ if !defined $_[1]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$_[0]{"prefix"} // ""
MC/DC0%0/1
$_[0]{"prefix"} // ""
$_[0]{"prefix"}
Truth table0%0/2
A
A= $_[0]{"prefix"}
| |||||||||||||||||||||||||||||
| 31 | 3 | $_[0]->{prefix} = $_[1]; | |||||||||||||||||||||||||||
| 32 | 3 | return $_[0]->{prefix}; | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 37 | ▶ | sub template { | ||||||||||||||||||||||||||
|
Subroutine
template: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 36 | 37 | ▶ | return $_[0]->{template} // q~~ if !defined $_[1]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$_[0]{"template"} // ""
MC/DC100%1/1
$_[0]{"template"} // ""
$_[0]{"template"}
Truth table100%2/2
A
A= $_[0]{"template"}
| |||||||||||||||||||||||||||||
| 37 | 1 | $_[0]->{template} = $_[1]; | |||||||||||||||||||||||||||
| 38 | 1 | return $_[0]->{template}; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 36 | ▶ | sub handle_entry { | ||||||||||||||||||||||||||
|
Subroutine
handle_entry: called CC=6 SCAR=18.4
Pod
documented
| |||||||||||||||||||||||||||||
| 42 | 36 | my ( $self, $hr_entry ) = @_; | |||||||||||||||||||||||||||
| 43 | 36 | ▶ | return unless $hr_entry; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 44 | 36 | ▶ | unless ( $hr_entry->{action} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 45 | 0 | require Geoffrey::Exception::General; | |||||||||||||||||||||||||||
| 46 | 0 | Geoffrey::Exception::General::throw_no_params( 'handle_entry', 'action', $hr_entry ); | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | 36 | my ( $s_sub, $s_action ) = Geoffrey::Utils::parse_package_sub( delete $hr_entry->{action} ); | |||||||||||||||||||||||||||
| 49 | 36 | my $o_action = $self->action($s_action); | |||||||||||||||||||||||||||
| 50 | 35 | ▶ | if ( !$s_sub || !$o_action->can($s_sub) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$s_sub and $o_action->can($s_sub)
MC/DC50%1/2
$s_sub and $o_action->can($s_sub)
$s_sub
$o_action->can($s_sub)
Truth table66%2/3
A and B
A= $s_subB= $o_action->can($s_sub)
| |||||||||||||||||||||||||||||
| 51 | 1 | require Geoffrey::Exception::RequiredValue; | |||||||||||||||||||||||||||
| 52 | 1 | Geoffrey::Exception::RequiredValue::throw_action_sub($s_action); | |||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | 34 | ▶ | $o_action->dryrun(1) if delete $hr_entry->{dryrun}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 55 | 34 | my $result = $o_action->$s_sub($hr_entry); | |||||||||||||||||||||||||||
| 56 | 12 | $o_action->dryrun(0); | |||||||||||||||||||||||||||
| 57 | 12 | return $result; | |||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | 30 | ▶ | sub handle_entries { | ||||||||||||||||||||||||||
|
Subroutine
handle_entries: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 62 | 30 | my ( $self, $ar_entries ) = @_; | |||||||||||||||||||||||||||
| 63 | 30 | ▶ | return unless $ar_entries; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 64 | 30 | $self->handle_entry($_) for ( @{$ar_entries} ); | |||||||||||||||||||||||||||
| 65 | 6 | return scalar @{$ar_entries}; | |||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | 3 | 1; # End of Geoffrey::Changeset | |||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | __END__ | ||||||||||||||||||||||||||||