line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::JSON::RPC::Autodoc::Response; |
2
|
4
|
|
|
4
|
|
13
|
use strict; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
84
|
|
3
|
4
|
|
|
4
|
|
12
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
80
|
|
4
|
4
|
|
|
4
|
|
1492
|
use HTTP::Message::PSGI; |
|
4
|
|
|
|
|
38829
|
|
|
4
|
|
|
|
|
178
|
|
5
|
4
|
|
|
4
|
|
19
|
use parent qw/HTTP::Response/; |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
10
|
|
6
|
4
|
|
|
4
|
|
9067
|
use Data::Recursive::Encode; |
|
4
|
|
|
|
|
31414
|
|
|
4
|
|
|
|
|
104
|
|
7
|
4
|
|
|
4
|
|
16
|
use Encode qw/decode_utf8 encode_utf8/; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
218
|
|
8
|
4
|
|
|
4
|
|
13
|
use JSON qw//; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
361
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub HTTP::Response::from_json { |
11
|
3
|
|
|
3
|
0
|
895
|
my $self = shift; |
12
|
3
|
|
|
|
|
8
|
my $content = $self->content(); |
13
|
3
|
50
|
|
|
|
25
|
return unless $content; |
14
|
3
|
|
|
|
|
8
|
return JSON::from_json(decode_utf8($content)); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub HTTP::Response::pretty_json { |
18
|
3
|
|
|
3
|
0
|
2
|
my $self = shift; |
19
|
3
|
|
|
|
|
6
|
my $content = $self->content(); |
20
|
3
|
50
|
|
|
|
22
|
return unless $content; |
21
|
3
|
|
|
|
|
4
|
my $data = JSON::from_json(decode_utf8($content)); |
22
|
3
|
|
|
|
|
78
|
my $json = JSON::to_json($data, { pretty => 1 }); |
23
|
3
|
|
|
|
|
58
|
return $json; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |