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