| 1 | ###################################################################### | ||||||||||||
| 2 | package Net::Amazon::Property::CE; | ||||||||||||
| 3 | ###################################################################### | ||||||||||||
| 4 | 24 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 24 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 24 | ▶ | use base qw(Net::Amazon::Property); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 24 | __PACKAGE__->make_accessor($_) for qw(brand ean label manufacturer model mpn | |||||||||||
| 9 | publisher studio upc warranty); | ||||||||||||
| 10 | 24 | __PACKAGE__->make_array_accessor($_) for qw(platforms features); | |||||||||||
| 11 | |||||||||||||
| 12 | |||||||||||||
| 13 | ################################################## | ||||||||||||
| 14 | 6 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||
| 15 | ################################################## | ||||||||||||
| 16 | 6 | my($class, %options) = @_; | |||||||||||
| 17 | |||||||||||||
| 18 | 6 | my $self = $class->SUPER::new(%options); | |||||||||||
| 19 | 6 | bless $self, $class; # Bless into this class | |||||||||||
| 20 | |||||||||||||
| 21 | 6 | ▶ | if(exists $options{xmlref}) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 22 | 6 | $self->init_via_xmlref($options{xmlref}); | |||||||||||
| 23 | } | ||||||||||||
| 24 | |||||||||||||
| 25 | 6 | return $self; | |||||||||||
| 26 | } | ||||||||||||
| 27 | |||||||||||||
| 28 | ################################################## | ||||||||||||
| 29 | 6 | ▶ | sub init_via_xmlref { | ||||||||||
|
Subroutine
init_via_xmlref: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 30 | ################################################## | ||||||||||||
| 31 | 6 | my($self, $xmlref) = @_; | |||||||||||
| 32 | |||||||||||||
| 33 | 6 | $self->SUPER::init_via_xmlref($xmlref); | |||||||||||
| 34 | |||||||||||||
| 35 | 6 | my $ref = $xmlref->{ItemAttributes}; | |||||||||||
| 36 | |||||||||||||
| 37 | 6 | $self->brand($ref->{Brand}); | |||||||||||
| 38 | 6 | $self->ean($ref->{EAN}); | |||||||||||
| 39 | 6 | $self->features($ref->{Feature}); | |||||||||||
| 40 | 6 | $self->label($ref->{Label}); | |||||||||||
| 41 | 6 | $self->manufacturer($ref->{Manufacturer}); | |||||||||||
| 42 | 6 | $self->model($ref->{Model}); | |||||||||||
| 43 | 6 | $self->mpn($ref->{MPN}); | |||||||||||
| 44 | 6 | ▶ | $self->platforms($ref->{Platform} || 'UNKNOWN'); | ||||||||||
|
Condition100%2/2
$ref->{'Platform'} || 'UNKNOWN'
MC/DC100%1/1
$ref->{'Platform'} || 'UNKNOWN'
$ref->{'Platform'}
Truth table100%2/2
A
A= $ref->{'Platform'}
| |||||||||||||
| 45 | 6 | $self->publisher($ref->{Publisher}); | |||||||||||
| 46 | 6 | $self->studio($ref->{Studio}); | |||||||||||
| 47 | 6 | $self->upc($ref->{UPC}); | |||||||||||
| 48 | 6 | $self->warranty($ref->{Warranty}); | |||||||||||
| 49 | |||||||||||||
| 50 | 6 | $self->NumMedia($ref->{NumberOfItems}); | |||||||||||
| 51 | } | ||||||||||||
| 52 | |||||||||||||
| 53 | ################################################## | ||||||||||||
| 54 | 0 | ▶ | sub platform { | ||||||||||
|
Subroutine
platform: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 55 | ################################################## | ||||||||||||
| 56 | 0 | my($self, $nameref) = @_; | |||||||||||
| 57 | |||||||||||||
| 58 | # Only return the first platform | ||||||||||||
| 59 | 0 | return ($self->platforms($nameref))[0]; | |||||||||||
| 60 | } | ||||||||||||
| 61 | |||||||||||||
| 62 | ################################################## | ||||||||||||
| 63 | 0 | ▶ | sub feature { | ||||||||||
|
Subroutine
feature: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 64 | ################################################## | ||||||||||||
| 65 | 0 | my($self, $nameref) = @_; | |||||||||||
| 66 | |||||||||||||
| 67 | # Only return the first feature | ||||||||||||
| 68 | 0 | return ($self->features($nameref))[0]; | |||||||||||
| 69 | } | ||||||||||||
| 70 | |||||||||||||
| 71 | |||||||||||||
| 72 | ################################################## | ||||||||||||
| 73 | 6 | ▶ | sub as_string { | ||||||||||
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 74 | ################################################## | ||||||||||||
| 75 | 6 | my($self) = @_; | |||||||||||
| 76 | |||||||||||||
| 77 | 6 | return join('/', $self->platforms) . ", " . | |||||||||||
| 78 | '"' . $self->title . '"' . ", " . | ||||||||||||
| 79 | $self->_best_effort_price() . ", " . | ||||||||||||
| 80 | $self->ASIN; | ||||||||||||
| 81 | } | ||||||||||||
| 82 | |||||||||||||
| 83 | 24 | 1; | |||||||||||
| 84 | |||||||||||||
| 85 | __END__ | ||||||||||||