line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Opsview::REST::QueryBuilder; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Opsview::REST::QueryBuilder::VERSION = '0.013'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
9
|
|
|
9
|
|
104432
|
use Moo::Role; |
|
9
|
|
|
|
|
25
|
|
|
9
|
|
|
|
|
64
|
|
7
|
9
|
|
|
9
|
|
13132
|
use URI; |
|
9
|
|
|
|
|
51399
|
|
|
9
|
|
|
|
|
398
|
|
8
|
9
|
|
|
9
|
|
8547
|
use URI::QueryParam; |
|
9
|
|
|
|
|
6614
|
|
|
9
|
|
|
|
|
2115
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
requires 'base'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has uri => ( |
13
|
|
|
|
|
|
|
is => 'ro', |
14
|
|
|
|
|
|
|
default => sub { URI->new; }, |
15
|
|
|
|
|
|
|
handles => [qw/ as_string /], |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has path => ( |
19
|
|
|
|
|
|
|
is => 'ro', |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has args => ( |
23
|
|
|
|
|
|
|
is => 'ro', |
24
|
|
|
|
|
|
|
isa => sub { die '"args" must be a hashref' unless ref $_[0] eq 'HASH' }, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub BUILDARGS { |
28
|
5
|
|
|
5
|
0
|
23047
|
my ($class, $path, @args) = @_; |
29
|
|
|
|
|
|
|
|
30
|
5
|
100
|
|
|
|
23
|
if (@_ == 1) { |
31
|
1
|
|
|
|
|
20
|
return {}; |
32
|
|
|
|
|
|
|
} else { |
33
|
|
|
|
|
|
|
return { |
34
|
4
|
|
|
|
|
111
|
path => $path, |
35
|
|
|
|
|
|
|
args => { @args }, |
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub BUILD { |
41
|
141
|
|
|
141
|
0
|
74293
|
my $self = shift; |
42
|
|
|
|
|
|
|
|
43
|
141
|
|
100
|
|
|
1104
|
$self->uri->path($self->base . ($self->path || '')); |
44
|
141
|
|
|
|
|
5867
|
$self->uri->query_form($self->args); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
__END__ |