Common/Procedure/Call/Version_1_0.pm

filter: Statementstmt 100% 25 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 33.3% 1 / 3 totaltotal 94.2% 33 / 35 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Common/Procedure/Return/Version_1_0.pm ↑ Summary Common/Procedure/Call/Version_2_0.pm »
1 #!/usr/bin/perl
2  
3 package JSON::RPC::Common::Procedure::Call::Version_1_0;
4 2 $JSON::RPC::Common::Procedure::Call::Version_1_0::VERSION = '0.11';
5 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 # ABSTRACT: JSON-RPC 1.0 request
7  
8 2 ▶use JSON::RPC::Common::Procedure::Return::Version_1_0;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use namespace::clean -except => [qw(meta)];
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 extends qw(JSON::RPC::Common::Procedure::Call);
13  
14 has '+version' => (
15 # default => "1.0", # broken, Moose::Meta::Method::Accessor gens numbers if looks_like_number
16 3 ▶ default => sub { "1.0" },
Subroutine __ANON__: called CC=1 SCAR=0.0
17 2 );
18  
19 2 has '+params' => (
20 isa => "ArrayRef",
21 required => 1,
22 );
23  
24 2 has '+id' => (
25 required => 1,
26 );
27  
28 2 has '+return_class' => (
29 default => "JSON::RPC::Common::Procedure::Return::Version_1_0",
30 );
31  
32 2 has '+error_class' => (
33 default => "JSON::RPC::Common::Procedure::Return::Version_1_0::Error",
34 );
35  
36 2 ▶sub is_notification {
Subroutine is_notification: called CC=1 SCAR=0.0
Pod documented
37 2 my $self = shift;
38 2 return not defined $self->id;
39 }
40  
41 1 ▶sub deflate_params {
Subroutine deflate_params: called CC=1 SCAR=0.0
Pod undocumented
42 1 my $self = shift;
43 1 return ( params => $self->params );
44 }
45  
46 1 ▶sub deflate_id {
Subroutine deflate_id: called CC=1 SCAR=0.0
Pod undocumented
47 1 my $self = shift;
48 1 return ( id => $self->id ); # never omitted, can be null instead
49 }
50  
51 2 __PACKAGE__->meta->make_immutable;
52  
53 2 __PACKAGE__
54  
55 __END__
« Common/Procedure/Return/Version_1_0.pm ↑ Summary Common/Procedure/Call/Version_2_0.pm »