Etcd/KV/Op.pm

filter: Statementstmt 78.5% 33 / 42 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.0% 9 / 10 Podpod 100% 1 / 1 totaltotal 72.8% 43 / 59 SCAR 15.0
CC
4
Cov
69%
create
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.5
« Etcd/Auth/RolePermission.pm ↑ Summary Etcd/Watch.pm »
1 9 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 package Net::Etcd::KV::Op;
3  
4 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 9 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 9 ▶use Types::Standard qw(InstanceOf Str Int Bool HashRef ArrayRef);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 9 ▶use MIME::Base64;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 9 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 9 ▶use JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 9 with 'Net::Etcd::Role::Actions';
14  
15 9 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 =head1 NAME
18  
19 Net::Etcd::KV::Op
20  
21 =cut
22  
23 9 our $VERSION = '0.021';
24  
25 =head1 DESCRIPTION
26  
27 Op
28  
29 =head1 ACCESSORS
30  
31 =head2 request_range
32  
33 =cut
34  
35 9 has request_range => (
36 is => 'ro',
37 );
38  
39 =head2 request_put
40  
41 =cut
42  
43 9 has request_put => (
44 is => 'ro',
45 );
46  
47 =head2 request_delete_range
48  
49 =cut
50  
51 9 has request_delete_range => (
52 is => 'ro',
53 );
54  
55 =head2 create
56  
57 create op
58  
59 =cut
60  
61 #TODO this dirty hack should be a perl data object and then make json.
62  
63 sub create {
64 0 ▶ my $self = shift;
Subroutine create: not called CC=4 SCAR=30.0
Pod documented
65 0 my @op;
66 0 my $put = $self->request_put;
67 0 my $range = $self->request_range;
68 0 my $delete_range = $self->request_delete_range;
69 0 ▶ push @op, '{"requestPut":' . $put->json_args . '}' if defined $put;
Branch: 1 branch
BranchTrueFalseTotal
if defined $put 0 0 0
70 0 ▶ push @op, '{"requestRange":' . $range->json_args . '}' if defined $range;
Branch: 1 branch
BranchTrueFalseTotal
if defined $range 0 0 0
71 0 ▶ push @op, '{"requestDeleteRange":' . $delete_range->json_args . '}' if defined $delete_range;
Branch: 1 branch
BranchTrueFalseTotal
if defined $delete_range 0 0 0
72 0 return @op;
73 }
74  
75 9 1;
« Etcd/Auth/RolePermission.pm ↑ Summary Etcd/Watch.pm »