File Coverage

blib/lib/WebService/LiveJournal/FriendList.pm
Criterion Covered Total %
statement 12 40 30.0
branch 0 8 0.0
condition n/a
subroutine 4 6 66.6
pod 0 2 0.0
total 16 56 28.5


line stmt bran cond sub pod time code
1             package WebService::LiveJournal::FriendList;
2              
3 1     1   1886 use strict;
  1         2  
  1         27  
4 1     1   5 use warnings;
  1         1  
  1         20  
5 1     1   4 use WebService::LiveJournal::List;
  1         1  
  1         15  
6 1     1   442 use WebService::LiveJournal::Friend;
  1         2  
  1         290  
7             our @ISA = qw/ WebService::LiveJournal::List /;
8              
9             # ABSTRACT: List of LiveJournal friends
10             our $VERSION = '0.07'; # 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 $friends = $arg{response}->value->{friends};
21 0           my $friendofs = $arg{response}->value->{friendofs};
22 0 0         if(defined $friends)
23             {
24 0           foreach my $f (@{ $friends })
  0            
25             {
26 0           $self->push(new WebService::LiveJournal::Friend(%{ $f }));
  0            
27             }
28             }
29 0 0         if(defined $friendofs)
30             {
31 0           foreach my $f (@{ $friendofs })
  0            
32             {
33 0           $self->push(new WebService::LiveJournal::Friend(%{ $f }));
  0            
34             }
35             }
36             }
37            
38 0 0         if(defined $arg{response_list})
39             {
40 0           foreach my $f (@{ $arg{response_list} })
  0            
41             {
42 0           $self->push(new WebService::LiveJournal::Friend(%{ $f }));
  0            
43             }
44             }
45            
46 0           return $self;
47             }
48              
49             sub as_string
50             {
51 0     0 0   my $self = shift;
52 0           my $str = '[friendlist ';
53 0           foreach my $friend (@{ $self })
  0            
54             {
55 0           $str .= $friend->as_string;
56             }
57 0           $str .= ']';
58 0           $str;
59             }
60              
61             1;
62              
63             __END__