| 1 | ###################################################################### | ||||||||||
| 2 | package Net::Amazon::Property::DVD; | ||||||||||
| 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(studio media nummedia upc mpaa_rating | |||||||||
| 9 | region_code label running_time publisher ean theatrical_release_date); | ||||||||||
| 10 | 24 | __PACKAGE__->make_array_accessor($_) for qw(actors directors features starring); | |||||||||
| 11 | |||||||||||
| 12 | ################################################## | ||||||||||
| 13 | 48 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 14 | ################################################## | ||||||||||
| 15 | 48 | my($class, %options) = @_; | |||||||||
| 16 | |||||||||||
| 17 | 48 | my $self = $class->SUPER::new(%options); | |||||||||
| 18 | 48 | bless $self, $class; # Bless into this class | |||||||||
| 19 | |||||||||||
| 20 | 48 | ▶ | if(exists $options{xmlref}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 48 | $self->init_via_xmlref($options{xmlref}); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 48 | return $self; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | ################################################## | ||||||||||
| 28 | 3 | ▶ | sub actor { | ||||||||
|
Subroutine
actor: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 29 | ################################################## | ||||||||||
| 30 | 3 | my($self, $nameref) = @_; | |||||||||
| 31 | |||||||||||
| 32 | # Only return the first director | ||||||||||
| 33 | 3 | return ($self->actors($nameref))[0]; | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | |||||||||||
| 37 | ################################################## | ||||||||||
| 38 | 4 | ▶ | sub director { | ||||||||
|
Subroutine
director: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 39 | ################################################## | ||||||||||
| 40 | 4 | my($self, $nameref) = @_; | |||||||||
| 41 | |||||||||||
| 42 | # Only return the first director | ||||||||||
| 43 | 4 | return ($self->directors($nameref))[0]; | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | ################################################## | ||||||||||
| 47 | 2 | ▶ | sub feature { | ||||||||
|
Subroutine
feature: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 48 | ################################################## | ||||||||||
| 49 | 2 | my($self, $nameref) = @_; | |||||||||
| 50 | |||||||||||
| 51 | # Only return the first feature | ||||||||||
| 52 | 2 | return ($self->features($nameref))[0]; | |||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | |||||||||||
| 56 | ################################################## | ||||||||||
| 57 | 48 | ▶ | sub init_via_xmlref { | ||||||||
|
Subroutine
init_via_xmlref: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 58 | ################################################## | ||||||||||
| 59 | 48 | my($self, $xmlref) = @_; | |||||||||
| 60 | |||||||||||
| 61 | 48 | $self->SUPER::init_via_xmlref($xmlref); | |||||||||
| 62 | |||||||||||
| 63 | 48 | my $ref = $xmlref->{ItemAttributes}; | |||||||||
| 64 | |||||||||||
| 65 | 48 | $self->actors($ref->{Actor}); | |||||||||
| 66 | 48 | $self->starring($ref->{Actor}); | |||||||||
| 67 | 48 | $self->directors($ref->{Director}); | |||||||||
| 68 | 48 | $self->ean($ref->{EAN}); | |||||||||
| 69 | 48 | $self->features($ref->{Format}); | |||||||||
| 70 | 48 | $self->label($ref->{Label}); | |||||||||
| 71 | 48 | $self->mpaa_rating($ref->{AudienceRating}); | |||||||||
| 72 | 48 | $self->publisher($ref->{Publisher}); | |||||||||
| 73 | 48 | $self->region_code($ref->{RegionCode}); | |||||||||
| 74 | 48 | $self->running_time($ref->{RunningTime}->{content}); | |||||||||
| 75 | 48 | $self->studio($ref->{Studio}); | |||||||||
| 76 | 48 | $self->upc($ref->{UPC}); | |||||||||
| 77 | 48 | $self->theatrical_release_date($ref->{TheatricalReleaseDate}); | |||||||||
| 78 | |||||||||||
| 79 | |||||||||||
| 80 | 48 | $self->media($ref->{Binding}); | |||||||||
| 81 | |||||||||||
| 82 | # $self->NumMedia($ref->{NumberOfItems}); | ||||||||||
| 83 | # $self->nummedia($ref->{NumberOfItems}); | ||||||||||
| 84 | 48 | $self->NumMedia($ref->{NumberOfDiscs}); | |||||||||
| 85 | 48 | $self->nummedia($ref->{NumberOfDiscs}); | |||||||||
| 86 | |||||||||||
| 87 | 48 | ▶ | if ( defined $ref->{TheatricalReleaseDate} ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 88 | 2 | my $year = (split(/\-/, $ref->{TheatricalReleaseDate}))[0]; | |||||||||
| 89 | 2 | $self->year($year); | |||||||||
| 90 | } | ||||||||||
| 91 | } | ||||||||||
| 92 | |||||||||||
| 93 | 24 | 1; | |||||||||
| 94 | |||||||||||
| 95 | __END__ | ||||||||||