Geocodio/JSON.pm

filter: Statementstmt 80.7% 21 / 26 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 6 / 9 Podpod 100% 2 / 2 totaltotal 78.3% 29 / 37 CC 1 SCAR 2.9
CC
1
Cov
81%
__ANON__
2.0
encode
2.0
decode
2.0
CRAP 1.3
« Geocodio/Request.pm ↑ Summary
1 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package WebService::Geocodio::JSON;
5 6 $WebService::Geocodio::JSON::VERSION = '0.05';
6 # ABSTRACT: A JSON de/serializer class
7  
8 6 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 6 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 6 ▶use JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 6 ▶use Carp qw(confess);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13  
14 has 'json' => (
15 is => 'ro',
16 lazy => 1,
17 0 ▶ default => sub { JSON->new() },
Subroutine __ANON__: not called CC=1 SCAR=6.9
18 6 );
19  
20  
21 0 ▶sub encode {
Subroutine encode: not called CC=1 SCAR=6.9
Pod documented
22 0 my ($self, $aref) = @_;
23  
24 0 return $self->json->encode($aref);
25 }
26  
27  
28 0 ▶sub decode {
Subroutine decode: not called CC=1 SCAR=6.9
Pod documented
29 0 my ($self, $data) = @_;
30  
31 0 return $self->json->decode($data);
32 }
33  
34 6 1;
35  
36 __END__
« Geocodio/Request.pm ↑ Summary