line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::JsonAPI::Autodoc::Response; |
2
|
13
|
|
|
13
|
|
70
|
use strict; |
|
13
|
|
|
|
|
22
|
|
|
13
|
|
|
|
|
475
|
|
3
|
13
|
|
|
13
|
|
66
|
use warnings; |
|
13
|
|
|
|
|
23
|
|
|
13
|
|
|
|
|
357
|
|
4
|
13
|
|
|
13
|
|
65
|
use utf8; |
|
13
|
|
|
|
|
21
|
|
|
13
|
|
|
|
|
90
|
|
5
|
13
|
|
|
13
|
|
262
|
use JSON; |
|
13
|
|
|
|
|
20
|
|
|
13
|
|
|
|
|
90
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
14
|
|
|
14
|
0
|
43
|
my ($class) = @_; |
9
|
|
|
|
|
|
|
|
10
|
14
|
|
|
|
|
152
|
bless { |
11
|
|
|
|
|
|
|
}, $class; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub parse { |
15
|
14
|
|
|
14
|
0
|
36
|
my ($self, $res) = @_; |
16
|
|
|
|
|
|
|
|
17
|
14
|
|
|
|
|
84
|
my $body = $res->content; |
18
|
14
|
|
|
|
|
200
|
my $content_type = $res->content_type; |
19
|
14
|
100
|
|
|
|
450
|
if ($content_type =~ m!^application/json!) { |
20
|
12
|
|
|
|
|
123
|
$body = to_json(from_json($res->decoded_content), { pretty => 1 }); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
return { |
24
|
14
|
|
|
|
|
2330
|
body => $body, |
25
|
|
|
|
|
|
|
content_type => $content_type, |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |