File Coverage

blib/lib/Catmandu/AlephX/Op/UpdateItem.pm
Criterion Covered Total %
statement 9 17 52.9
branch n/a
condition n/a
subroutine 3 5 60.0
pod 0 2 0.0
total 12 24 50.0


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