line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Stub.pm 7373 2012-04-09 18:00:33Z chris $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package WebService::Flixster::Movie::Stub; |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
71
|
|
6
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
90
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
10
|
use base qw(WebService::Flixster::Movie); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1193
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use Carp; |
13
|
|
|
|
|
|
|
our @CARP_NOT = qw(WebService::Flixster WebService::Flixster::Actor); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use WebService::Flixster::Movie; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw( |
18
|
|
|
|
|
|
|
_stub_id |
19
|
|
|
|
|
|
|
_stub_title |
20
|
|
|
|
|
|
|
)); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _new { |
24
|
|
|
|
|
|
|
my $class = shift; |
25
|
|
|
|
|
|
|
my $ws = shift; |
26
|
|
|
|
|
|
|
my $data = shift; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $self = $class->SUPER::_new($ws, {'id' => $data->{'id'}}, '_defer_fetch' => 1); |
29
|
|
|
|
|
|
|
bless $self, $class; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
$self->_stub_id($data->{'id'}); |
32
|
|
|
|
|
|
|
if (exists $data->{'title'}) { $self->_stub_title($data->{'title'}); } |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
if (0) { $self->_check_unparsed($data); } |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
return $self; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub obj { |
40
|
|
|
|
|
|
|
my $self = shift; |
41
|
|
|
|
|
|
|
return WebService::Flixster::Movie->_new($self->_ws(), {'id' => $self->id()}); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub id { |
45
|
|
|
|
|
|
|
my $self = shift; |
46
|
|
|
|
|
|
|
return $self->_stub_id(); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub title { |
50
|
|
|
|
|
|
|
my $self = shift; |
51
|
|
|
|
|
|
|
my $nosuper = shift; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
if (defined $self->_stub_title()) { |
54
|
|
|
|
|
|
|
return $self->_stub_title(); |
55
|
|
|
|
|
|
|
} elsif ($nosuper) { |
56
|
|
|
|
|
|
|
return undef; |
57
|
|
|
|
|
|
|
} else { |
58
|
|
|
|
|
|
|
return $self->SUPER::title(); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub _check_unparsed { |
63
|
|
|
|
|
|
|
use Storable qw(dclone); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
my $self = shift; |
66
|
|
|
|
|
|
|
my $d = dclone(shift); |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
delete $d->{'id'}; |
69
|
|
|
|
|
|
|
delete $d->{'title'}; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
if (scalar keys %$d != 0) { |
72
|
|
|
|
|
|
|
die "Remaining keys: " . join(", ", keys %$d); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |