blib/lib/Raisin/Encoder/JSON.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 4 totaltotal 85.1% 23 / 27 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« examples/sample-app/lib/RESTApp/User.pm ↑ Summary blib/lib/Raisin/Encoder/YAML.pm »
1 #!perl
2 #PODNAME: Raisin::Encoder::JSON
3 #ABSTRACT: JSON serialization plugin for Raisin.
4  
5 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 package Raisin::Encoder::JSON;
9 6 $Raisin::Encoder::JSON::VERSION = '0.94';
10 6 ▶use JSON::MaybeXS qw();
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 6 my $json = JSON::MaybeXS->new(utf8 => 1);
13  
14 71 ▶sub detectable_by { [qw(application/json text/x-json text/json json)] }
Subroutine detectable_by: called CC=1 SCAR=0.0
Pod undocumented
15  
16 9 ▶sub content_type { 'application/json; charset=utf-8' }
Subroutine content_type: called CC=1 SCAR=0.0
Pod undocumented
17  
18 9 ▶sub serialize { $json->allow_blessed->convert_blessed->encode($_[1]) }
Subroutine serialize: called CC=1 SCAR=0.0
Pod undocumented
19  
20 9 ▶sub deserialize { $json->allow_blessed->convert_blessed->decode($_[1]->content) }
Subroutine deserialize: called CC=1 SCAR=0.0
Pod undocumented
21  
22 6 1;
23  
24 __END__
« examples/sample-app/lib/RESTApp/User.pm ↑ Summary blib/lib/Raisin/Encoder/YAML.pm »