ResponseHelper/JSON.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 96.3% 26 / 27 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« ResponseHelper/Attachment.pm ↑ Summary
1 package Plack::ResponseHelper::JSON;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Plack::Response;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶sub helper {
Subroutine helper: called CC=1 SCAR=0.0
Pod undocumented
9 1 ▶ return sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
10 1 my $r = shift;
11 1 my $body = encode_json $r;
12 1 my $response = Plack::Response->new(200);
13 1 $response->content_type('application/json; charset=utf-8');
14 1 $response->body($body);
15 1 return $response;
16 1 };
17 }
18  
19 1 1;
20  
21 __END__
« ResponseHelper/Attachment.pm ↑ Summary