Kubernetes/Resource.pm

filter: Statementstmt 52.1% 12 / 23 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 2 totaltotal 42.4% 14 / 33 CC 3 SCAR 12.6
CC
3
Cov
44%
delete
6.0
update
3.5
BEGIN
1.0
CRAP 3.5
« Kubernetes/Role/APIAccess.pm ↑ Summary Kubernetes/Role/ResourceFactory.pm »
1 package Net::Kubernetes::Resource;
2 2 $Net::Kubernetes::Resource::VERSION = '0.05';
3 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 =head1 NAME
6  
7 Net::Kubernetes::Resource
8  
9 =head1 VERSION
10  
11 version 0.05
12  
13 =cut
14  
15 2 with 'Net::Kubernetes::Role::APIAccess';
16  
17  
18 2 has kind => (
19 is => 'ro',
20 isa => 'Str',
21 required => 0,
22 );
23  
24 2 has api_version => (
25 is => 'ro',
26 isa => 'Str',
27 required => 0,
28 );
29  
30 2 has metadata => (
31 is => 'rw',
32 isa => 'HashRef',
33 required => 1
34 );
35  
36 sub delete {
37 0 ▶ my($self) = @_;
Subroutine delete: not called CC=2 SCAR=17.9
Pod undocumented
38 0 my($res) = $self->ua->request($self->create_request(DELETE => $self->url.'/'.$self->base_path));
39 0 ▶ if ($res->is_success) {
Branch: 1 branch
BranchTrueFalseTotal
if ($res->is_success) 0 0 0
40 0 return 1;
41 }
42 0 return 0;
43 }
44  
45 sub update {
46 0 ▶ my($self) = @_;
Subroutine update: not called CC=2 SCAR=12.6
Pod undocumented
47 0 my($res) = $self->ua->request($self->create_request(PUT => $self->url.'/'.$self->base_path, undef, $self->json->encode({spec=>$self->spec, apiVersion=>$self->api_version, kind=>$self->kind, metadata=>$self->metadata})));
48 0 ▶ if ($res->is_success) {
Branch: 1 branch
BranchTrueFalseTotal
if ($res->is_success) 0 0 0
49 0 return 1;
50 }
51 2 ▶ use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
52 0 print Dumper($res)."\n";
53 0 return 0;
54 }
55  
56  
57 2 return 42;
« Kubernetes/Role/APIAccess.pm ↑ Summary Kubernetes/Role/ResourceFactory.pm »