File Coverage

blib/lib/WebService/LiveJournal/Friend.pm
Criterion Covered Total %
statement 9 29 31.0
branch n/a
condition 0 3 0.0
subroutine 3 13 23.0
pod 6 10 60.0
total 18 55 32.7


line stmt bran cond sub pod time code
1             package WebService::LiveJournal::Friend;
2              
3 12     12   38 use strict;
  12         13  
  12         256  
4 12     12   47 use warnings;
  12         14  
  12         229  
5 12     12   3606 use WebService::LiveJournal::Thingie;
  12         17  
  12         2656  
6             our @ISA = qw/ WebService::LiveJournal::Thingie /;
7              
8             # ABSTRACT: LiveJournal friend class
9             our $VERSION = '0.08'; # VERSION
10              
11              
12             sub new
13             {
14 0     0 0   my $ob = shift;
15 0   0       my $class = ref($ob) || $ob;
16 0           my $self = bless { }, $class;
17              
18 0           my %arg = @_;
19 0           $self->{username} = $arg{username}; # req
20 0           $self->{fullname} = $arg{fullname}; # req
21 0           $self->{bgcolor} = $arg{bgcolor}; # req
22 0           $self->{fgcolor} = $arg{fgcolor}; # req
23 0           $self->{type} = $arg{type}; # opt
24 0           $self->{groupmask} = $arg{groupmask}; # req
25              
26 0           return $self;
27             }
28              
29              
30 0     0 0   sub name { shift->username(@_) }
31 0     0 1   sub username { $_[0]->{username} }
32 0     0 1   sub fullname { $_[0]->{fullname} }
33 0     0 1   sub bgcolor { $_[0]->{bgcolor} }
34 0     0 1   sub fgcolor { $_[0]->{fgcolor} }
35 0     0 1   sub type { $_[0]->{type} }
36 0     0 0   sub groupmask { $_[0]->{groupmask} }
37 0     0 1   sub mask { $_[0]->{groupmask} }
38              
39 0     0 0   sub as_string { '[friend ' . $_[0]->{username} . ']' }
40              
41             1;
42              
43             __END__