| 1 | #=============================================================================== | ||
| 2 | # FILE: Show.pm | ||
| 3 | # AUTHOR: Kyle Brandt (mn), kyle@kbrandt.com , http://www.kbrandt.com | ||
| 4 | #=============================================================================== | ||
| 5 | |||
| 6 | use strict; | ||
| 7 | use warnings; | ||
| 8 | |||
| 9 | package WebService::TVRage::Show; | ||
| 10 | use Mouse; | ||
| 11 | use Data::Dumper; | ||
| 12 | has '_showHash' => ( is => 'rw' ); | ||
| 13 | |||
| 14 | sub getShowID { | ||
| 15 | my $self = shift; | ||
| 16 | return $self->_showHash()->{showid} // ''; | ||
| 17 | } | ||
| 18 | |||
| 19 | sub getLink { | ||
| 20 | my $self = shift; | ||
| 21 | return $self->_showHash()->{link} // ''; | ||
| 22 | } | ||
| 23 | |||
| 24 | sub getCountry { | ||
| 25 | my $self = shift; | ||
| 26 | return $self->_showHash()->{country} // ''; | ||
| 27 | } | ||
| 28 | |||
| 29 | sub getStatus { | ||
| 30 | my $self = shift; | ||
| 31 | return $self->_showHash()->{status} // ''; | ||
| 32 | } | ||
| 33 | |||
| 34 | sub getYearStarted { | ||
| 35 | my $self = shift; | ||
| 36 | return $self->_showHash()->{started} // ''; | ||
| 37 | } | ||
| 38 | |||
| 39 | sub getYearEnded { | ||
| 40 | my $self = shift; | ||
| 41 | return $self->_showHash()->{ended} // ''; | ||
| 42 | } | ||
| 43 | |||
| 44 | sub getGenres { | ||
| 45 | my $self = shift; | ||
| 46 | my @genres; | ||
| 47 | my %genreHash = %{$self->_showHash()->{genres}}; | ||
| 48 | foreach my $genre ( keys(%genreHash) ) { | ||
| 49 | push(@genres, $genreHash{$genre}); | ||
| 50 | } | ||
| 51 | #print Dumper($self->_showHash()->{genres}); | ||
| 52 | return @genres; | ||
| 53 | } | ||
| 54 | 1; | ||
| 55 | |||
| 56 | =head1 NAME | ||
| 57 | |||
| 58 | WebService::TVRage::Show Object returned by WebService::TVRage::ShowList->getShow(), Contains details for the requested show title | ||
| 59 | |||
| 60 | =head1 SYNOPSIS | ||
| 61 | |||
| 62 | my $heroesSearch = WebService::TVRage::ShowSearchRequest->new( showTitle => 'Heroes' ); | ||
| 63 | my $showList = $heroesSearch->search(); | ||
| 64 | foreach my $showtitle ($showList->getTitleList()) { | ||
| 65 | my $show = $showList->getTitle($showtitle); | ||
| 66 | print $show->getLink(), "\n"; | ||
| 67 | } | ||
| 68 | |||
| 69 | =head1 Methods | ||
| 70 | |||
| 71 | =over 1 | ||
| 72 | |||
| 73 | =item _showHash | ||
| 74 | |||
| 75 | This is populated by WebService::TVRage::ShowList->getShow(), you shouldn't need to edit this, but you might want to look at it with Data::Dumper | ||
| 76 | |||
| 77 | =back | ||
| 78 | |||
| 79 | =head2 getShowID() | ||
| 80 | |||
| 81 | $show->getShowID() | ||
| 82 | |||
| 83 | Returns TVRage's ID number for the show which you can use to make a WebService::TVRage::EpisodeListRequest | ||
| 84 | |||
| 85 | =head2 getLink() | ||
| 86 | |||
| 87 | $show->getLink() | ||
| 88 | |||
| 89 | Returns TVRage's URL for the show | ||
| 90 | |||
| 91 | =head2 getCountry() | ||
| 92 | |||
| 93 | $show->getCountry() | ||
| 94 | |||
| 95 | Returns the country where the show was made (aired?) | ||
| 96 | |||
| 97 | =head2 getStatus() | ||
| 98 | |||
| 99 | $show->getStatus() | ||
| 100 | |||
| 101 | Returns which indicates if the show is still active or if has been cancelled | ||
| 102 | |||
| 103 | =head2 getYearStarted() | ||
| 104 | |||
| 105 | $show->getYearStarted() | ||
| 106 | |||
| 107 | Returns a 4 digit year as a string, the year the show first aired | ||
| 108 | |||
| 109 | =head2 getYearEnded() | ||
| 110 | |||
| 111 | $show->getYearEnded() | ||
| 112 | |||
| 113 | Returns a 4 digit year as a string, the year the show ended, or 0 if still active | ||
| 114 | |||
| 115 | =head2 getGenres() | ||
| 116 | |||
| 117 | $show->getGenres() | ||
| 118 | |||
| 119 | Returns an array of strings, the strings are the genres that TVRage has classified the show as being. | ||
| 120 | |||
| 121 | =head1 AUTHOR | ||
| 122 | |||
| 123 | Kyle Brandt, kyle@kbrandt.com | ||
| 124 | http://www.kbrandt.com | ||
| 125 | |||
| 126 | =cut |