line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Response::JSON::Path; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: use JSON::Path for searching JSON responses |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
602512
|
use Class::Method::Modifiers qw/install_modifier/; |
|
2
|
|
|
|
|
2616
|
|
|
2
|
|
|
|
|
99
|
|
6
|
2
|
|
|
2
|
|
447
|
use Mojo::Message; |
|
2
|
|
|
|
|
243646
|
|
|
2
|
|
|
|
|
28
|
|
7
|
2
|
|
|
2
|
|
1024
|
use JSON::Path; |
|
2
|
|
|
|
|
94208
|
|
|
2
|
|
|
|
|
19
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub import { |
10
|
2
|
|
|
2
|
|
28
|
my $class = shift; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
install_modifier "Mojo::Message", 'around', 'json', |
13
|
|
|
|
|
|
|
sub { |
14
|
2
|
|
|
2
|
|
19202
|
my $orig = shift; |
15
|
2
|
|
|
|
|
4
|
my $self = shift; |
16
|
|
|
|
|
|
|
|
17
|
2
|
100
|
|
|
|
7
|
if (@_) { |
18
|
1
|
|
|
|
|
12
|
return JSON::Path->new($_[0])->value($orig->($self)); |
19
|
|
|
|
|
|
|
} else { |
20
|
1
|
|
|
|
|
4
|
return $orig->($self); |
21
|
|
|
|
|
|
|
} |
22
|
2
|
|
|
|
|
15
|
}; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1 |
26
|
|
|
|
|
|
|
|