| 1 | # -*- perl -*- | ||||||||||||||||||||||||||||
| 2 | # !!! DO NOT EDIT !!! | ||||||||||||||||||||||||||||
| 3 | # This file was automatically generated. | ||||||||||||||||||||||||||||
| 4 | package Net::Amazon::Validate::ItemSearch::us::Power; | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use 5.006; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 5 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | 5 | my ($class , %options) = @_; | |||||||||||||||||||||||||||
| 12 | 5 | my $self = { | |||||||||||||||||||||||||||
| 13 | '_default' => 'Books', | ||||||||||||||||||||||||||||
| 14 | %options, | ||||||||||||||||||||||||||||
| 15 | }; | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 5 | push @{$self->{_options}}, 'Books'; | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 5 | bless $self, $class; | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 5 | ▶ | sub user_or_default { | ||||||||||||||||||||||||||
|
Subroutine
user_or_default: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 23 | 5 | my ($self, $user) = @_; | |||||||||||||||||||||||||||
| 24 | 5 | ▶ | if (defined $user && length($user) > 0) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $user and length $user > 0
MC/DC50%1/2
defined $user and length $user > 0
defined $user
length $user > 0
Truth table66%2/3
A and B
A= defined $userB= length $user > 0
| |||||||||||||||||||||||||||||
| 25 | 4 | return $self->find_match($user); | |||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | 1 | return $self->default(); | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 1 | ▶ | sub default { | ||||||||||||||||||||||||||
|
Subroutine
default: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 31 | 1 | my ($self) = @_; | |||||||||||||||||||||||||||
| 32 | 1 | return $self->{_default}; | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 4 | ▶ | sub find_match { | ||||||||||||||||||||||||||
|
Subroutine
find_match: called CC=3 SCAR=11.7
Pod
undocumented
| |||||||||||||||||||||||||||||
| 36 | 4 | my ($self, $value) = @_; | |||||||||||||||||||||||||||
| 37 | 4 | for (@{$self->{_options}}) { | |||||||||||||||||||||||||||
| 38 | 4 | ▶ | return $_ if lc($_) eq lc($value); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | 0 | die "$value is not a valid value for us::Power!\n"; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 2 | 1; | |||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | __END__ | ||||||||||||||||||||||||||||