Client/Resource/AppData.pm

filter: Statementstmt 56.5% 13 / 23 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 3 / 6 Podpod 100% 3 / 3 totaltotal 46.3% 19 / 41 CC 4 SCAR 17.7
CC
4
Cov
43%
get_data
12.0
set_data
6.0
get_user_ids
2.0
CRAP 5.9
« Client.pm ↑ Summary Client/Request/FetchFriends.pm »
1 package Net::OpenSocial::Client::Resource::AppData;
2  
3 1 ▶use Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 extends 'Net::OpenSocial::Client::Resource';
5  
6 1 ▶use Net::OpenSocial::Client::Type::Service qw(APPDATA);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 has '+service' => (
9 default => APPDATA,
10 );
11  
12 0 ▶sub get_user_ids {
Subroutine get_user_ids: not called CC=1 SCAR=6.9
Pod documented
13 0 my $self = shift;
14 0 return keys %{ $self->fields };
15 }
16  
17 0 ▶sub get_data {
Subroutine get_data: not called CC=3 SCAR=24.8
Pod documented
18 0 my ( $self, $user_id, $key ) = @_;
19 0 ▶ if ( exists $self->fields->{$user_id}
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->fields->{$user_id} and $self->fields->{$user_id}{$key}) 0 0 0
Condition0%0/3
exists $self->fields->{$user_id} and $self->fields->{$user_id}{$key}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $self->fields->{$user_id} and $self->fields->{$user_id}{$key}
exists $self->fields->{$user_id} $self->fields->{$user_id}{$key}
Truth table0%0/3
A and B
A= exists $self->fields->{$user_id}B= $self->fields->{$user_id}{$key}
ABresult
0X0
100
111
20 && $self->fields->{$user_id}{$key} )
21 {
22 0 return $self->fields->{$user_id}{$key};
23 }
24 }
25  
26 0 ▶sub set_data {
Subroutine set_data: not called CC=2 SCAR=17.9
Pod documented
27 0 my ( $self, $user_id, $key, $value ) = @_;
28 0 ▶ unless ( exists $self->fields->{$user_id} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $self->fields->{$user_id}) 0 0 0
29 0 $self->fields->{$user_id} = {};
30 }
31 0 $self->fields->{$user_id}{$key} = $value;
32 }
33  
34 1 ▶no Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
35 1 __PACKAGE__->meta->make_immutable;
36 1 1;
37  
38 =head1 NAME
39  
40 Net::OpenSocial::Client::Resource::AppData - appdata
41  
42 =head1 SYNOPSIS
43  
44 =head1 DESCRIPTION
45  
46 =head1 METHODS
47  
48 =head2 get_user_ids
49  
50 my @ids = $appdata->get_user_ids();
51  
52 =head2 get_data
53  
54 my $value = $appdata->get_data( $user_id, $key );
55  
56 =head2 set_data
57  
58 $appdata->set_data( $user_id, $key, $value );
59  
60 =head1 SEE ALSO
61  
62 L<Net::OpenSocial::Client::Resource>
63 L<Net::OpenSocial::Client::Resource::Factory>
64 L<Net::OpenSocial::Client::Resource::Person>
65 L<Net::OpenSocial::Client::Resource::Group>
66 L<Net::OpenSocial::Client::Resource::Activity>
67  
68 =head1 AUTHOR
69  
70 Lyo Kato, E<lt>lyo.kato@gmail.comE<gt>
71  
72 =head1 COPYRIGHT AND LICENSE
73  
74 Copyright (C) 2009 by Lyo Kato
75  
76 This library is free software; you can redistribute it and/or modify
77 it under the same terms as Perl itself, either Perl version 5.8.8 or,
78 at your option, any later version of Perl 5 you may have available.
79  
80 =cut
81  
« Client.pm ↑ Summary Client/Request/FetchFriends.pm »