line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Movie.pm 6486 2011-06-13 13:42:02Z chris $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
WebService::MoviePosterDB::Movie |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 DESCRIPTION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=cut |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
package WebService::MoviePosterDB::Movie; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
16
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
48
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '0.18'; |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
135
|
|
21
|
|
|
|
|
|
|
our @CARP_NOT = qw(WebService::MoviePosterDB); |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
1
|
|
8
|
use base qw(Class::Accessor); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2297
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw( |
26
|
|
|
|
|
|
|
imdb |
27
|
|
|
|
|
|
|
title |
28
|
|
|
|
|
|
|
year |
29
|
|
|
|
|
|
|
page |
30
|
|
|
|
|
|
|
posters |
31
|
|
|
|
|
|
|
)); |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
1
|
|
5989
|
use WebService::MoviePosterDB::Poster; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub _new { |
36
|
5
|
|
|
5
|
|
12
|
my $class = shift; |
37
|
5
|
|
|
|
|
6
|
my $json = shift; |
38
|
5
|
|
|
|
|
16
|
my $self = {}; |
39
|
|
|
|
|
|
|
|
40
|
5
|
50
|
|
|
|
20
|
if (defined $json->{'errors'}) { croak join("; ", map {s/\.*$//; $_} @{$json->{'errors'}}); } |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
41
|
|
|
|
|
|
|
|
42
|
5
|
|
|
|
|
12
|
bless $self, $class; |
43
|
|
|
|
|
|
|
|
44
|
5
|
|
|
|
|
25
|
$self->imdb($json->{'imdb'}); |
45
|
5
|
|
|
|
|
95
|
$self->title($json->{'title'}); |
46
|
5
|
|
|
|
|
64
|
$self->year($json->{'year'}); |
47
|
5
|
|
|
|
|
62
|
$self->page($json->{'page'}); |
48
|
5
|
|
|
|
|
46
|
$self->posters( [ map { WebService::MoviePosterDB::Poster->_new($_) } @{$json->{'posters'}} ] ); |
|
5
|
|
|
|
|
48
|
|
|
5
|
|
|
|
|
13
|
|
49
|
|
|
|
|
|
|
|
50
|
5
|
|
|
|
|
683
|
return $self; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 METHODS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 tconst() |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub tconst { |
60
|
10
|
|
|
10
|
1
|
3473
|
my $self = shift; |
61
|
10
|
|
|
|
|
30
|
return sprintf("tt%07d", $self->imdb()); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 imdbid() |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub imdbid { |
69
|
5
|
|
|
5
|
1
|
2536
|
my $self = shift; |
70
|
5
|
|
|
|
|
12
|
return $self->tconst(); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head2 imdb() |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 title() |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head2 year() |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 page() |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 posters() |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=cut |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
1; |