PicasaWeb/MediaEntry.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 41 CC 1 SCAR 6.9
CC
1
Cov
0%
list_tags
2.0
list_comments
2.0
BEGIN
2.0
CRAP 2.0
1 package Net::Google::PicasaWeb::MediaEntry;
2 {
3 $Net::Google::PicasaWeb::MediaEntry::VERSION = '0.12';
4 }
5 use Moose;
6  
7 # ABSTRACT: represents a single Picasa Web photo or video
8  
9 extends 'Net::Google::PicasaWeb::MediaFeed';
10  
11  
12 has album_id => (
13 is => 'rw',
14 isa => 'Str',
15 );
16  
17  
18 has width => (
19 is => 'rw',
20 isa => 'Int',
21 );
22  
23  
24 has height => (
25 is => 'rw',
26 isa => 'Int',
27 );
28  
29  
30 has size => (
31 is => 'rw',
32 isa => 'Int',
33 );
34  
35  
36 has timestamp => (
37 is => 'rw', # should probably be 'ro'
38 isa => 'Int',
39 );
40  
41  
42 override from_feed => sub {
43 my ($class, $service, $entry) = @_;
44 my $self = super();
45  
46 $self->album_id($entry->field('gphoto:albumid'));
47  
48 $self->width($entry->field('gphoto:width'))
49 if $entry->field('gphoto:width');
50 $self->height($entry->field('gphoto:height'))
51 if $entry->field('gphoto:height');
52 $self->size($entry->field('gphoto:size'))
53 if $entry->field('gphoto:size');
54 $self->timestamp($entry->field('gphoto:timestamp'))
55 if $entry->field('gphoto:timestamp');
56  
57 return $self;
58 };
59  
60  
61 sub list_tags {
62 my ($self, %params) = @_;
63 $params{kind} = 'tag';
64  
65 return $self->service->list_entries(
66 'Net::Google::PicasaWeb::Tag',
67 $self->url,
68 %params
69 );
70 }
71  
72  
73 sub list_comments {
74 my ($self, %params) = @_;
75 $params{kind} = 'comment';
76  
77 return $self->service->list_entries(
78 'Net::Google::PicasaWeb::Comment',
79 $self->url,
80 %params
81 );
82 }
83  
84 __PACKAGE__->meta->make_immutable;
85  
86 1;
87  
88 __END__