File Coverage

blib/lib/PONAPI/DAO/Request/UpdateRelationships.pm
Criterion Covered Total %
statement 13 13 100.0
branch 3 4 75.0
condition n/a
subroutine 4 4 100.0
pod 0 2 0.0
total 20 23 86.9


line stmt bran cond sub pod time code
1             # ABSTRACT: DAO request - update relationships
2             package PONAPI::DAO::Request::UpdateRelationships;
3              
4 8     8   50 use Moose;
  8         20  
  8         65  
5              
6             extends 'PONAPI::DAO::Request';
7              
8             with 'PONAPI::DAO::Request::Role::UpdateLike',
9             'PONAPI::DAO::Request::Role::HasDataMethods',
10             'PONAPI::DAO::Request::Role::HasID',
11             'PONAPI::DAO::Request::Role::HasRelationshipType';
12              
13             has data => (
14             is => 'ro',
15             isa => 'Maybe[HashRef|ArrayRef]',
16             predicate => 'has_data',
17             );
18              
19 13     13 0 95 sub check_data_type_match { 1 } # to avoid code duplications in HasDataMethods
20              
21             sub execute {
22 14     14 0 31 my $self = shift;
23 14 100       538 if ( $self->is_valid ) {
24 9         323 my @ret = $self->repository->update_relationships( %{ $self } );
  9         71  
25              
26 6 50       104 $self->_add_success_meta(@ret)
27             if $self->_verify_update_response(@ret);
28             }
29              
30 10         79 return $self->response();
31             }
32              
33              
34             __PACKAGE__->meta->make_immutable;
35 8     8   54178 no Moose; 1;
  8         20  
  8         45  
36              
37             __END__
38              
39             =pod
40              
41             =encoding UTF-8
42              
43             =head1 NAME
44              
45             PONAPI::DAO::Request::UpdateRelationships - DAO request - update relationships
46              
47             =head1 VERSION
48              
49             version 0.002005
50              
51             =head1 AUTHORS
52              
53             =over 4
54              
55             =item *
56              
57             Mickey Nasriachi <mickey@cpan.org>
58              
59             =item *
60              
61             Stevan Little <stevan@cpan.org>
62              
63             =item *
64              
65             Brian Fraser <hugmeir@cpan.org>
66              
67             =back
68              
69             =head1 COPYRIGHT AND LICENSE
70              
71             This software is copyright (c) 2016 by Mickey Nasriachi, Stevan Little, Brian Fraser.
72              
73             This is free software; you can redistribute it and/or modify it under
74             the same terms as the Perl 5 programming language system itself.
75              
76             =cut