| 1 | package Pickles::View; | ||||||||||||||||||||
| 2 | 3 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 3 | ▶ | use base qw(Class::Data::Inheritable); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 3 | __PACKAGE__->mk_classdata(qw(__Config)); | |||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 8 | 0 | my $class = shift; | |||||||||||||||||||
| 9 | 0 | my $self = bless {}, $class; | |||||||||||||||||||
| 10 | 0 | $self; | |||||||||||||||||||
| 11 | } | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 0 | ▶ | sub render { die 'abstract method!'; } | ||||||||||||||||||
|
Subroutine
render: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 14 | 2 | ▶ | sub content_type { 'text/html'; } | ||||||||||||||||||
|
Subroutine
content_type: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 6 | ▶ | sub config { | ||||||||||||||||||
|
Subroutine
config: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||
| 17 | 6 | my $class = shift; | |||||||||||||||||||
| 18 | 6 | ▶ | return ($class->__Config || {}) unless @_; | ||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$class->__Config || {}
MC/DC0%0/1
$class->__Config || {}
$class->__Config
Truth table50%1/2
A
A= $class->__Config
| |||||||||||||||||||||
| 19 | 4 | my $values = $_[0]; | |||||||||||||||||||
| 20 | 4 | ▶ | if ( @_ > 1 ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 21 | 2 | $values = { @_ }; | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | 4 | $class->__Config( $values ); | |||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 2 | ▶ | sub merge_config { | ||||||||||||||||||
|
Subroutine
merge_config: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 27 | 2 | my( $self, $c ) = @_; | |||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | 2 | my $class = ref $self; | |||||||||||||||||||
| 30 | 2 | my $appname = $c->config->appname; | |||||||||||||||||||
| 31 | 2 | (my $config_key = $class) =~ s/^${appname}:://; | |||||||||||||||||||
| 32 | 2 | ▶ | my $config = $c->config->{$config_key} || {}; | ||||||||||||||||||
|
Condition50%1/2
$c->config->{$config_key} || {}
MC/DC0%0/1
$c->config->{$config_key} || {}
$c->config->{$config_key}
Truth table50%1/2
A
A= $c->config->{$config_key}
| |||||||||||||||||||||
| 33 | my %config = ( | ||||||||||||||||||||
| 34 | 2 | %{$self->config}, | |||||||||||||||||||
| 35 | 2 | %{$config}, | |||||||||||||||||||
| 36 | ); | ||||||||||||||||||||
| 37 | 2 | return \%config; | |||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 3 | 1; | |||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | __END__ | ||||||||||||||||||||