| 1 | package ODS::Table::Column::Base; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 72 | ▶ | use YAOO; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 72 | ▶ | use ODS::Utils qw/clone error/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 72 | auto_build; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 72 | has name => rw, isa(string); | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 72 | has type => rw, isa(string); | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 72 | has value => rw, isa(any); | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 72 | has mandatory => rw, isa(boolean); | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 72 | has no_render => rw, isa(boolean); | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 72 | has sortable => rw, isa(any); | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 72 | has filterable => rw, isa(any); | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 72 | has field => rw, isa(hash); | |||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 72 | has inflated => rw, isa(boolean); | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | sub build_column { | ||||||||||||||||||||||||||||
| 28 | 39374 | ▶ | my ($self, $data, $already_inflated, $serialize) = @_; | ||||||||||||||||||||||||||
|
Subroutine
build_column: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 39374 | $self = clone($self); | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 39374 | ▶ | $self->serialize_class($serialize) if $serialize && $self->can('serialize_class'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$serialize and $self->can("serialize_class")
MC/DC50%1/2
$serialize and $self->can("serialize_class")
$serialize
$self->can("serialize_class")
Truth table66%2/3
A and B
A= $serializeB= $self->can("serialize_class")
| |||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 39374 | $self->inflated($already_inflated); | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 39374 | $self->value($data); | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 39374 | $self->inflate($data); | |||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 39374 | return $self; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | sub store_column { | ||||||||||||||||||||||||||||
| 44 | 25816 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||
|
Subroutine
store_column: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 25816 | return $self->validate()->deflate(); | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | sub validate { | ||||||||||||||||||||||||||||
| 50 | 51581 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||
|
Subroutine
validate: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | # has_validation_class | ||||||||||||||||||||||||||||
| 53 | 51581 | ▶ | return $self unless $self->can('validation'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 44737 | $self->value( | |||||||||||||||||||||||||||
| 56 | $self->validation($self->value) | ||||||||||||||||||||||||||||
| 57 | ); | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 44737 | return $self; | |||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | sub inflate { | ||||||||||||||||||||||||||||
| 63 | 39374 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||
|
Subroutine
inflate: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | # has_validation_class | ||||||||||||||||||||||||||||
| 66 | 39374 | ▶ | return $self unless not $self->inflated and $self->can('inflation'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not $self->inflated and $self->can("inflation")
MC/DC100%2/2
not $self->inflated and $self->can("inflation")
not $self->inflated
$self->can("inflation")
Truth table100%3/3
not(A) and B
A= not $self->inflatedB= $self->can("inflation")
| |||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | 2735 | $self->value( | |||||||||||||||||||||||||||
| 69 | $self->inflation($self->value) | ||||||||||||||||||||||||||||
| 70 | ); | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 2735 | $self->inflated(1); | |||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | 2735 | return $self; | |||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | sub deflate { | ||||||||||||||||||||||||||||
| 78 | 25816 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||
|
Subroutine
deflate: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | # has_validation_class | ||||||||||||||||||||||||||||
| 81 | 25816 | ▶ | return $self unless $self->inflated && $self->can('deflation'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->inflated and $self->can("deflation")
MC/DC100%2/2
$self->inflated and $self->can("deflation")
$self->inflated
$self->can("deflation")
Truth table100%3/3
A and B
A= $self->inflatedB= $self->can("deflation")
| |||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | 5145 | $self->value( | |||||||||||||||||||||||||||
| 84 | $self->deflation($self->value) | ||||||||||||||||||||||||||||
| 85 | ); | ||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | 5145 | $self->inflated(0); | |||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | 5145 | return $self; | |||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | 72 | 1; | |||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | __END__ | ||||||||||||||||||||||||||||