line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::RabbitMQ::Management::API::Result; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Net::RabbitMQ::Management::API::Result::VERSION = '0.01'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: RabbitMQ Management API result object |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
24
|
use Moo; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
47
|
|
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
1673
|
use JSON::Any; |
|
4
|
|
|
|
|
51
|
|
|
4
|
|
|
|
|
46
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has 'response' => ( |
14
|
|
|
|
|
|
|
handles => { |
15
|
|
|
|
|
|
|
code => 'code', |
16
|
|
|
|
|
|
|
raw_content => 'content', |
17
|
|
|
|
|
|
|
request => 'request', |
18
|
|
|
|
|
|
|
success => 'is_success', |
19
|
|
|
|
|
|
|
}, |
20
|
|
|
|
|
|
|
is => 'ro', |
21
|
|
|
|
|
|
|
isa => sub { die 'must be a HTTP::Response, but is ' . ref $_[0] unless ref $_[0] eq 'HTTP::Response' }, |
22
|
|
|
|
|
|
|
required => 1, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
has 'content' => ( |
27
|
|
|
|
|
|
|
builder => '_build_content', |
28
|
|
|
|
|
|
|
clearer => 'clear_content', |
29
|
|
|
|
|
|
|
is => 'ro', |
30
|
|
|
|
|
|
|
lazy => 1, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has '_json' => ( |
34
|
|
|
|
|
|
|
builder => '_build__json', |
35
|
|
|
|
|
|
|
is => 'ro', |
36
|
|
|
|
|
|
|
isa => sub { die 'must be a JSON::Any, but is ' . ref $_[0] unless ref $_[0] eq 'JSON::Any' }, |
37
|
|
|
|
|
|
|
lazy => 1, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub _build__json { |
42
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
43
|
0
|
|
|
|
|
0
|
return JSON::Any->new; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub _build_content { |
47
|
1
|
|
|
1
|
|
3226
|
my ($self) = @_; |
48
|
1
|
50
|
|
|
|
25
|
if ( $self->raw_content ) { |
49
|
0
|
|
|
|
|
0
|
return $self->_json->decode( $self->raw_content ); |
50
|
|
|
|
|
|
|
} |
51
|
1
|
|
|
|
|
51
|
return {}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |