File Coverage

blib/lib/WebService/LiveJournal/EventList.pm
Criterion Covered Total %
statement 12 29 41.3
branch 0 4 0.0
condition n/a
subroutine 4 6 66.6
pod 0 2 0.0
total 16 41 39.0


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