blib/lib/Net/Fastly/Settings.pm

filter: Statementstmt 25.0% 8 / 32 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 16.6% 2 / 12 Podpod 100% 4 / 4 totaltotal 28.0% 14 / 50 CC 2 SCAR 9.0
CC
2
Cov
24%
settings
6.0
_get_path
2.0
_put_path
2.0
CRAP 2.5
« blib/lib/Net/Fastly/Version.pm ↑ Summary blib/lib/Net/Fastly/Director.pm »
1 package Net::Fastly::Settings;
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use base qw(Net::Fastly::Model);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 Net::Fastly::Settings->mk_accessors(qw(service_id version));
7  
8 =head1 NAME
9  
10 Net::Fastly::Invoice - - a representation of a Fastly monthly invoice
11  
12 =head1 ACCESSORS
13  
14 =head2 service_id
15  
16 The id of the service these settings are for
17  
18 =head2 version
19  
20 The version number these settings for
21  
22 =head2 settings
23  
24 A hash ref of all the individual settings
25  
26 =cut
27  
28 sub _get_path {
29 0 ▶ my $class = shift;
Subroutine _get_path: not called CC=1 SCAR=6.9
30 0 my $service = shift;
31 0 my $number = shift;
32 0 return "/service/$service/version/$number/settings";
33 }
34  
35 sub _put_path {
36 0 ▶ my $class = shift;
Subroutine _put_path: not called CC=1 SCAR=6.9
37 0 my $obj = shift;
38 0 return $class->_get_path($obj->service_id, $obj->version);
39 }
40  
41 sub settings {
42 0 ▶ my $self = shift;
Subroutine settings: not called CC=2 SCAR=17.9
Pod documented
43 0 ▶ $self->{_settings} = { map { $_ => $self->{$_} } grep !/^(_|service_id$|version$)/, keys %$self } unless $self->{_settings};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"_settings"} 0 0 0
44 0 return $self->{_settings};
45 }
46  
47 sub _as_hash {
48 0 ▶ my $self = shift;
Subroutine _as_hash: not called CC=1 SCAR=6.9
49 0 my $settings = $self->settings;
50 0 return %$settings;
51 }
52  
53 0 ▶sub _skip_list { 1 }
Subroutine _skip_list: not called CC=1 SCAR=6.9
54 0 ▶sub _post_path { die "You can't POST to settings" }
Subroutine _post_path: not called CC=1 SCAR=6.9
55 0 ▶sub _delete_path { die "You can't DELETE to settings" }
Subroutine _delete_path: not called CC=1 SCAR=6.9
56  
57 =head2 delete
58  
59 Delete this object. Equivalent to
60  
61 $fastly->delete_<class>($object);
62  
63 =cut
64 0 ▶sub delete { die "You can't delete an invoice" }
Subroutine delete: not called CC=1 SCAR=6.9
Pod documented
65  
66 package Net::Fastly;
67  
68 sub get_settings {
69 0 ▶ my $self = shift;
Subroutine get_settings: not called CC=1 SCAR=6.9
Pod documented
70 0 my $class = "Net::Fastly::Settings";
71 0 $self->_get($class, @_);
72 }
73  
74 sub update_settings {
75 0 ▶ my $self = shift;
Subroutine update_settings: not called CC=1 SCAR=6.9
Pod documented
76 0 my $class = "Net::Fastly::Settings";
77 0 $self->_update($class, @_);
78 }
79 5 1;
« blib/lib/Net/Fastly/Version.pm ↑ Summary blib/lib/Net/Fastly/Director.pm »