line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::AlephX::Op::ItemData; |
2
|
1
|
|
|
1
|
|
85713
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
158121
|
|
|
1
|
|
|
|
|
8
|
|
3
|
1
|
|
|
1
|
|
277
|
use Catmandu::Util qw(:check :is); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
381
|
|
4
|
1
|
|
|
1
|
|
6
|
use Moo; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "1.072"; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
with('Catmandu::AlephX::Response'); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has items => ( |
11
|
|
|
|
|
|
|
is => 'ro', |
12
|
|
|
|
|
|
|
lazy => 1, |
13
|
|
|
|
|
|
|
isa => sub{ |
14
|
|
|
|
|
|
|
check_array_ref($_[0]); |
15
|
|
|
|
|
|
|
for(@{ $_[0] }){ |
16
|
|
|
|
|
|
|
check_hash_ref($_); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
}, |
19
|
|
|
|
|
|
|
default => sub { |
20
|
|
|
|
|
|
|
[]; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
); |
23
|
0
|
|
|
0
|
0
|
|
sub op { 'item-data' } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub parse { |
26
|
0
|
|
|
0
|
0
|
|
my($class,$str_ref) = @_; |
27
|
0
|
|
|
|
|
|
my $xpath = xpath($str_ref); |
28
|
0
|
|
|
|
|
|
my $op = op(); |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
my @items; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
for my $item($xpath->find("/$op/item")->get_nodelist()){ |
33
|
0
|
|
|
|
|
|
push @items,get_children($item,1); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__PACKAGE__->new( |
37
|
0
|
|
|
|
|
|
session_id => $xpath->findvalue("/$op/session-id"), |
38
|
|
|
|
|
|
|
errors => $class->parse_errors($xpath), |
39
|
|
|
|
|
|
|
items => \@items, |
40
|
|
|
|
|
|
|
content_ref => $str_ref |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |