line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::JSON::RPC::Autodoc::Response; |
2
|
4
|
|
|
4
|
|
15
|
use strict; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
87
|
|
3
|
4
|
|
|
4
|
|
12
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
127
|
|
4
|
4
|
|
|
4
|
|
1454
|
use HTTP::Message::PSGI; |
|
4
|
|
|
|
|
39218
|
|
|
4
|
|
|
|
|
191
|
|
5
|
4
|
|
|
4
|
|
19
|
use parent qw/HTTP::Response/; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
12
|
|
6
|
4
|
|
|
4
|
|
9102
|
use Data::Recursive::Encode; |
|
4
|
|
|
|
|
31609
|
|
|
4
|
|
|
|
|
105
|
|
7
|
4
|
|
|
4
|
|
18
|
use Encode qw/decode_utf8 encode_utf8/; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
211
|
|
8
|
4
|
|
|
4
|
|
14
|
use JSON qw//; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
386
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub HTTP::Response::from_json { |
11
|
3
|
|
|
3
|
0
|
901
|
my $self = shift; |
12
|
3
|
|
|
|
|
10
|
my $content = $self->content(); |
13
|
3
|
50
|
|
|
|
26
|
return unless $content; |
14
|
3
|
|
|
|
|
10
|
return JSON::from_json(decode_utf8($content)); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub HTTP::Response::pretty_json { |
18
|
3
|
|
|
3
|
0
|
3
|
my $self = shift; |
19
|
3
|
|
|
|
|
6
|
my $content = $self->content(); |
20
|
3
|
50
|
|
|
|
23
|
return unless $content; |
21
|
3
|
|
|
|
|
6
|
my $data = JSON::from_json(decode_utf8($content)); |
22
|
3
|
|
|
|
|
77
|
my $json = JSON::to_json($data, { pretty => 1 }); |
23
|
3
|
|
|
|
|
61
|
return $json; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |