| 1 | package Badger::Data::Facet::Class; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 3 | ▶ | use Carp; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 3 | ▶ | use Badger::Data::Facets; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | use Badger::Class | ||||||||||||||||||||
| 6 | 3 | version => 0.01, | |||||||||||||||||||
| 7 | debug => 0, | ||||||||||||||||||||
| 8 | uber => 'Badger::Class', | ||||||||||||||||||||
| 9 | utils => 'camel_case', | ||||||||||||||||||||
| 10 | constants => 'DELIMITER ARRAY', | ||||||||||||||||||||
| 11 | constant => { | ||||||||||||||||||||
| 12 | FACETS => 'Badger::Data::Facets', | ||||||||||||||||||||
| 13 | FACET => 'Badger::Data::Facet', | ||||||||||||||||||||
| 14 | }, | ||||||||||||||||||||
| 15 | hooks => { | ||||||||||||||||||||
| 16 | type => \&type, | ||||||||||||||||||||
| 17 | args => \&args, | ||||||||||||||||||||
| 18 | opts => \&opts, | ||||||||||||||||||||
| 19 | 3 | ▶ | }; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | sub type { | ||||||||||||||||||||
| 23 | 10 | ▶ | my ($self, $type) = @_; | ||||||||||||||||||
|
Subroutine
type: called CC=2 SCAR=7.6
Pod
documented
| |||||||||||||||||||||
| 24 | 10 | ▶ | my $facet = $self->FACETS->prototype->find($type) | ||||||||||||||||||
|
Condition33%1/3
$self->FACETS->prototype->find($type) || croak("Invalid facet type: $type\n")
MC/DC0%0/2
$self->FACETS->prototype->find($type) || croak("Invalid facet type: $type\n")
$self->FACETS->prototype->find($type)
croak("Invalid facet type: $type\n")
Truth table33%1/3
A || B
A= $self->FACETS->prototype->find($type)B= croak("Invalid facet type: $type\n")
| |||||||||||||||||||||
| 25 | || croak "Invalid facet type: $type\n"; | ||||||||||||||||||||
| 26 | 10 | $self->base($facet); | |||||||||||||||||||
| 27 | } | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | sub args { | ||||||||||||||||||||
| 31 | 10 | ▶ | my ($self, $args) = @_; | ||||||||||||||||||
|
Subroutine
args: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 10 | ▶ | $args = [ split(DELIMITER, $args) ] | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 34 | unless ref $args eq ARRAY; | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 10 | $self->var( ARGS => $args ); | |||||||||||||||||||
| 37 | 10 | $self->mutators($args); | |||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | sub opts { | ||||||||||||||||||||
| 42 | 0 | ▶ | my ($self, $opts) = @_; | ||||||||||||||||||
|
Subroutine
opts: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | 0 | ▶ | $opts = [ split(DELIMITER, $opts) ] | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 45 | unless ref $opts eq ARRAY; | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | 0 | $self->var( OPTS => $opts ); | |||||||||||||||||||
| 48 | 0 | $self->mutators($opts); | |||||||||||||||||||
| 49 | } | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | 3 | 1; | |||||||||||||||||||
| 53 | __END__ | ||||||||||||||||||||