Pixela/User.pm

filter: Statementstmt 100% 32 / 32 Branchbran n/a Conditioncond 100% 4 / 4 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 9 / 9 Podpod 60.0% 3 / 5 totaltotal 96.1% 50 / 52 CC 3 SCAR 4.4
CC
3
Cov
100%
create
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« Pixela/Pixel.pm ↑ Summary
1 package WebService::Pixela::User;
2 6 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 6 our $VERSION = "0.021";
8  
9 44 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
10 44 my ($class,$pixela_client) = @_;
11 44 return bless +{
12 client => $pixela_client,
13 }, $class;
14 }
15  
16 10 ▶sub client {
Subroutine client: called CC=1 SCAR=0.0
Pod undocumented
17 10 my $self = shift;
18 10 return $self->{client};
19 }
20  
21 2 ▶sub create {
Subroutine create: called CC=3 SCAR=11.0
Pod documented
22 2 my ($self,%args) = @_;
23 2 my $client = $self->client;
24  
25 my $params = {
26 username => $client->username,
27 token => $client->token,
28 agreeTermsOfService => $args{agree_terms_of_service} || "yes",
29 2 ▶ notMinor => $args{not_minor} || "yes",
Condition100%4/4
$args{'agree_terms_of_service'} || 'yes'
l!l
11
$args{'not_minor'} || 'yes'
l!l
11
MC/DC100%1/1
$args{'agree_terms_of_service'} || 'yes'
$args{'agree_terms_of_service'}
MC/DC100%1/1
$args{'not_minor'} || 'yes'
$args{'not_minor'}
Truth table100%2/2
A
A= $args{'agree_terms_of_service'}
Aresult
11
00
Truth table100%2/2
A
A= $args{'not_minor'}
Aresult
11
00
30 };
31 2 my $res = $client->request('POST','users/',$params);
32 2 return $res;
33 }
34  
35 1 ▶sub update {
Subroutine update: called CC=1 SCAR=0.0
Pod documented
36 1 my ($self,$newtoken) = @_;
37 1 my $client = $self->client;
38  
39 1 my $params = {
40 newToken => $newtoken,
41 };
42 1 my $res = $client->request_with_xuser_in_header('PUT',('users/'.$client->username),$params);
43 1 $self->client->token($newtoken);
44 1 return $res;
45 }
46  
47 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
Pod documented
48 1 my $self = shift;
49 1 my $client = $self->client;
50  
51 1 my $res = $client->request_with_xuser_in_header('DELETE',('users/'.$client->username),{});
52 1 return $res;
53 }
54  
55  
56 6 1;
57 __END__
« Pixela/Pixel.pm ↑ Summary