line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::JSON::RPC::Autodoc::Response; |
2
|
4
|
|
|
4
|
|
12
|
use strict; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
88
|
|
3
|
4
|
|
|
4
|
|
14
|
use warnings; |
|
4
|
|
|
|
|
2
|
|
|
4
|
|
|
|
|
91
|
|
4
|
4
|
|
|
4
|
|
1475
|
use HTTP::Message::PSGI; |
|
4
|
|
|
|
|
42170
|
|
|
4
|
|
|
|
|
184
|
|
5
|
4
|
|
|
4
|
|
21
|
use parent qw/HTTP::Response/; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
12
|
|
6
|
4
|
|
|
4
|
|
9234
|
use Data::Recursive::Encode; |
|
4
|
|
|
|
|
32286
|
|
|
4
|
|
|
|
|
106
|
|
7
|
4
|
|
|
4
|
|
20
|
use Encode qw/decode_utf8 encode_utf8/; |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
216
|
|
8
|
4
|
|
|
4
|
|
16
|
use JSON qw//; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
386
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub HTTP::Response::from_json { |
11
|
3
|
|
|
3
|
0
|
909
|
my $self = shift; |
12
|
3
|
|
|
|
|
10
|
my $content = $self->content(); |
13
|
3
|
50
|
|
|
|
27
|
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
|
2
|
my $self = shift; |
19
|
3
|
|
|
|
|
7
|
my $content = $self->content(); |
20
|
3
|
50
|
|
|
|
22
|
return unless $content; |
21
|
3
|
|
|
|
|
6
|
my $data = JSON::from_json(decode_utf8($content)); |
22
|
3
|
|
|
|
|
122
|
my $json = JSON::to_json($data, { pretty => 1 }); |
23
|
3
|
|
|
|
|
60
|
return $json; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |