| 1 | package WWW::Deezer::Obj; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 5 | our $VERSION = '0.03'; | |||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 5 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use Moose::Util::TypeConstraints; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | # base class for representing Deezer objects | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 5 | subtype 'JSONBoolean' => (as 'Int'); | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | coerce 'JSONBoolean' => ( | ||||||||||||||||||||||||||||
| 13 | from 'Ref', | ||||||||||||||||||||||||||||
| 14 | 1 | ▶ | via { JSON::is_bool($_) } | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | 5 | ); | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | subtype 'Url' => as 'Str', | ||||||||||||||||||||||||||||
| 18 | 12 | ▶ | where { /^http/ }; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 5 | has 'deezer_obj', is => 'rw', isa => 'Ref'; | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | sub reinit_attr_values { | ||||||||||||||||||||||||||
|
Subroutine
reinit_attr_values: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 23 | 0 | my ($self, $new) = @_; | |||||||||||||||||||||||||||
| 24 | 0 | ▶ | my $package = caller || __PACKAGE__; | ||||||||||||||||||||||||||
|
Condition0%0/2
caller || __PACKAGE__
MC/DC0%0/1
caller || __PACKAGE__
caller
Truth table0%0/2
A
A= caller
| |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 0 | my @attrs = $package->meta->get_all_attributes(); | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 0 | foreach my $attr (@attrs) { | |||||||||||||||||||||||||||
| 29 | 0 | my $name = $attr->name; | |||||||||||||||||||||||||||
| 30 | 0 | eval { | |||||||||||||||||||||||||||
| 31 | 0 | ▶ | $self->$name($new->$name) if ($attr->get_write_method && $name ne 'deezer_obj'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$attr->get_write_method and $name ne "deezer_obj"
MC/DC0%0/2
$attr->get_write_method and $name ne "deezer_obj"
$attr->get_write_method
$name ne "deezer_obj"
Truth table0%0/3
A and B
A= $attr->get_write_methodB= $name ne "deezer_obj"
| |||||||||||||||||||||||||||||
| 32 | }; | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 0 | ▶ | if ($@) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 35 | 0 | warn ($@); | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 5 | 1; | |||||||||||||||||||||||||||