DBIC/Role/JsonEncoder.pm

filter: Statementstmt 100% 12 / 12 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 94.1% 16 / 17 CC 2 SCAR 4.2
CC
2
Cov
93%
_build_json_encoder
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« DBIC/Resource/Role/SetWritable.pm ↑ Summary DBIC/Util.pm »
1 package WebAPI::DBIC::Role::JsonEncoder;
2 25 $WebAPI::DBIC::Role::JsonEncoder::VERSION = '0.004002';
3  
4 25 ▶use JSON::MaybeXS qw(JSON);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 25 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 25 has _json_encoder => (
10 is => 'ro',
11 builder => '_build_json_encoder',
12 handles => {
13 encode_json => 'encode',
14 decode_json => 'decode',
15 },
16 );
17  
18 169 ▶sub _build_json_encoder {
Subroutine _build_json_encoder: called CC=2 SCAR=7.1
19 169 my $codec = JSON->new->ascii;
20 169 ▶ $codec->canonical->pretty if $ENV{WEBAPI_DBIC_DEBUG};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"WEBAPI_DBIC_DEBUG"} 0 169 169
21 169 return $codec;
22 }
23  
24 25 1;
25  
26 __END__
« DBIC/Resource/Role/SetWritable.pm ↑ Summary DBIC/Util.pm »