line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::Client::Response; |
2
|
1
|
|
|
1
|
|
8
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.0001'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
361
|
use JSON::MaybeXS (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
195
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has res => ( |
9
|
|
|
|
|
|
|
is => 'ro', |
10
|
|
|
|
|
|
|
isa => sub { |
11
|
|
|
|
|
|
|
die 'res must be a HTTP::Response object' |
12
|
|
|
|
|
|
|
unless shift->isa('HTTP::Response'); |
13
|
|
|
|
|
|
|
}, |
14
|
|
|
|
|
|
|
required => 1, |
15
|
|
|
|
|
|
|
handles => [qw( |
16
|
|
|
|
|
|
|
code |
17
|
|
|
|
|
|
|
content |
18
|
|
|
|
|
|
|
decoded_content |
19
|
|
|
|
|
|
|
is_error |
20
|
|
|
|
|
|
|
is_success |
21
|
|
|
|
|
|
|
status_line |
22
|
|
|
|
|
|
|
)], |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has json => ( |
26
|
|
|
|
|
|
|
is => 'ro', |
27
|
|
|
|
|
|
|
lazy => 1, |
28
|
|
|
|
|
|
|
default => sub { JSON::MaybeXS->new() }, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub data { |
32
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
33
|
0
|
|
|
|
|
|
return $self->json->decode($self->decoded_content); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub ok { |
37
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
38
|
0
|
|
|
|
|
|
return $self->is_success; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |