File Coverage

blib/lib/PONAPI/DAO/Request/Retrieve.pm
Criterion Covered Total %
statement 12 12 100.0
branch 4 4 100.0
condition n/a
subroutine 3 3 100.0
pod 0 1 0.0
total 19 20 95.0


line stmt bran cond sub pod time code
1             # ABSTRACT: DAO request - retrieve
2             package PONAPI::DAO::Request::Retrieve;
3              
4 8     8   42 use Moose;
  8         21  
  8         53  
5              
6             extends 'PONAPI::DAO::Request';
7              
8             with 'PONAPI::DAO::Request::Role::HasFields',
9             'PONAPI::DAO::Request::Role::HasFilter',
10             'PONAPI::DAO::Request::Role::HasInclude',
11             # paginate included resources
12             'PONAPI::DAO::Request::Role::HasPage',
13             # sort is needed by page
14             'PONAPI::DAO::Request::Role::HasSort',
15             'PONAPI::DAO::Request::Role::HasID';
16              
17             sub execute {
18 54     54 0 126 my $self = shift;
19              
20 54 100       2262 if ( $self->is_valid ) {
21 40         1596 $self->repository->retrieve( %{ $self } );
  40         357  
22 37 100       1766 $self->document->add_null_resource
23             unless $self->document->has_resource_builders;
24             }
25              
26 51         305 return $self->response();
27             }
28              
29             __PACKAGE__->meta->make_immutable;
30 8     8   50929 no Moose; 1;
  8         19  
  8         44  
31              
32             __END__
33              
34             =pod
35              
36             =encoding UTF-8
37              
38             =head1 NAME
39              
40             PONAPI::DAO::Request::Retrieve - DAO request - retrieve
41              
42             =head1 VERSION
43              
44             version 0.002005
45              
46             =head1 AUTHORS
47              
48             =over 4
49              
50             =item *
51              
52             Mickey Nasriachi <mickey@cpan.org>
53              
54             =item *
55              
56             Stevan Little <stevan@cpan.org>
57              
58             =item *
59              
60             Brian Fraser <hugmeir@cpan.org>
61              
62             =back
63              
64             =head1 COPYRIGHT AND LICENSE
65              
66             This software is copyright (c) 2016 by Mickey Nasriachi, Stevan Little, Brian Fraser.
67              
68             This is free software; you can redistribute it and/or modify it under
69             the same terms as the Perl 5 programming language system itself.
70              
71             =cut