Amazon/Validate/ItemSearch/ca/EAN.pm untested

filter: Statementstmt 0.0% 0 / 95 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 115 CC 3 SCAR 13.3
CC
3
Cov
0%
user_or_default
6.0
find_match
6.0
new
2.0
CRAP 3.8
1 # -*- perl -*-
2 # !!! DO NOT EDIT !!!
3 # This file was automatically generated.
4 package Net::Amazon::Validate::ItemSearch::ca::EAN;
5  
6 use 5.006;
7 use strict;
8 use warnings;
9  
10 sub new {
11 my ($class , %options) = @_;
12 my $self = {
13 '_default' => 'Books',
14 %options,
15 };
16  
17 push @{$self->{_options}}, 'Actor';
18 push @{$self->{_options}}, 'Artist';
19 push @{$self->{_options}}, 'AudienceRating';
20 push @{$self->{_options}}, 'Author';
21 push @{$self->{_options}}, 'Blended';
22 push @{$self->{_options}}, 'Books';
23 push @{$self->{_options}}, 'Brand';
24 push @{$self->{_options}}, 'BrowseNode';
25 push @{$self->{_options}}, 'Classical';
26 push @{$self->{_options}}, 'Composer';
27 push @{$self->{_options}}, 'Condition';
28 push @{$self->{_options}}, 'Conductor';
29 push @{$self->{_options}}, 'Count';
30 push @{$self->{_options}}, 'DVD';
31 push @{$self->{_options}}, 'Director';
32 push @{$self->{_options}}, 'Electronics';
33 push @{$self->{_options}}, 'ForeignBooks';
34 push @{$self->{_options}}, 'ItemPage';
35 push @{$self->{_options}}, 'Keywords';
36 push @{$self->{_options}}, 'Manufacturer';
37 push @{$self->{_options}}, 'MaximumPrice';
38 push @{$self->{_options}}, 'MerchantId';
39 push @{$self->{_options}}, 'MinimumPrice';
40 push @{$self->{_options}}, 'Music';
41 push @{$self->{_options}}, 'MusicLabel';
42 push @{$self->{_options}}, 'Power';
43 push @{$self->{_options}}, 'Publisher';
44 push @{$self->{_options}}, 'ReleaseDate';
45 push @{$self->{_options}}, 'Software';
46 push @{$self->{_options}}, 'SoftwareVideoGames';
47 push @{$self->{_options}}, 'Sort';
48 push @{$self->{_options}}, 'Title';
49 push @{$self->{_options}}, 'VHS';
50 push @{$self->{_options}}, 'Video';
51 push @{$self->{_options}}, 'VideoGames';
52  
53 bless $self, $class;
54 }
55  
56 sub user_or_default {
57 my ($self, $user) = @_;
58 if (defined $user && length($user) > 0) {
59 return $self->find_match($user);
60 }
61 return $self->default();
62 }
63  
64 sub default {
65 my ($self) = @_;
66 return $self->{_default};
67 }
68  
69 sub find_match {
70 my ($self, $value) = @_;
71 for (@{$self->{_options}}) {
72 return $_ if lc($_) eq lc($value);
73 }
74 die "$value is not a valid value for ca::EAN!\n";
75 }
76  
77 1;
78  
79 __END__