blib/lib/Minima/View/JSON.pm

filter: Statementstmt 100% 14 / 14 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 100% 24 / 24 CC 3 SCAR 5.6
CC
3
Cov
100%
render
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« blib/lib/Minima/Router.pm ↑ Summary blib/lib/Minima.pm »
1 2 ▶use v5.40;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use experimental 'class';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 ▶class Minima::View::JSON :isa(Minima::View);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 field $app :param;
9  
10 1 ▶method prepare_response ($response)
Subroutine prepare_response: called CC=1 SCAR=0.0
Pod documented
11 {
12 1 $response->content_type('application/json');
13 }
14  
15 3 ▶method render ($data = {})
Subroutine render: called CC=3 SCAR=11.0
Pod documented
16 3 {
17 3 ▶ $app->development
Branch: 1 branch
BranchTrueFalseTotal
$app->development ? : 1 2 3
18 ? JSON->new->utf8->pretty->encode($data)
19 : encode_json $data
20 ;
21 }
22  
23 __END__
« blib/lib/Minima/Router.pm ↑ Summary blib/lib/Minima.pm »