File Coverage

blib/lib/WebService/LiveJournal/EventList.pm
Criterion Covered Total %
statement 10 12 83.3
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 14 16 87.5


line stmt bran cond sub pod time code
1             package WebService::LiveJournal::EventList;
2              
3 1     1   1019 use strict;
  1         2  
  1         32  
4 1     1   5 use warnings;
  1         1  
  1         26  
5 1     1   5 use WebService::LiveJournal::List;
  1         1  
  1         17  
6 1     1   48 use WebService::LiveJournal::Event;
  0            
  0            
7             our @ISA = qw/ WebService::LiveJournal::List /;
8              
9             # ABSTRACT: List of LiveJournal events
10             our $VERSION = '0.07'; # VERSION
11              
12              
13             sub init
14             {
15             my $self = shift;
16             my %arg = @_;
17            
18             if(defined $arg{response})
19             {
20             my $events = $arg{response}->value->{events};
21             if(defined $events)
22             {
23             foreach my $e (@{ $events })
24             {
25             $self->push(new WebService::LiveJournal::Event(client => $arg{client}, %{ $e }));
26             }
27             }
28             }
29            
30             return $self;
31             }
32              
33             sub as_string
34             {
35             my $self = shift;
36             my $str = '[eventlist ';
37             foreach my $friend (@{ $self })
38             {
39             $str .= $friend->as_string;
40             }
41             $str .= ']';
42             $str;
43             }
44              
45             1;
46              
47             __END__