File Coverage

blib/lib/PONAPI/DAO/Request/Role/HasPage.pm
Criterion Covered Total %
statement 10 10 100.0
branch 4 4 100.0
condition n/a
subroutine 3 3 100.0
pod n/a
total 17 17 100.0


line stmt bran cond sub pod time code
1             # ABSTRACT: DAO request role - `page`
2             package PONAPI::DAO::Request::Role::HasPage;
3              
4 8     8   4359 use Moose::Role;
  8         20  
  8         54  
5              
6             has page => (
7             traits => [ 'Hash' ],
8             is => 'ro',
9             isa => 'HashRef',
10             handles => {
11             "has_page" => 'count',
12             },
13             );
14              
15             sub _validate_page {
16 112     112   270 my ( $self, $args ) = @_;
17              
18 112 100       341 return unless defined $args->{page};
19              
20 8 100       334 $self->has_page
21             or $self->_bad_request( "`page` is missing values" );
22              
23 8         20 return;
24             }
25              
26 8     8   40740 no Moose::Role; 1;
  8         21  
  8         35  
27              
28             __END__
29              
30             =pod
31              
32             =encoding UTF-8
33              
34             =head1 NAME
35              
36             PONAPI::DAO::Request::Role::HasPage - DAO request role - `page`
37              
38             =head1 VERSION
39              
40             version 0.003003
41              
42             =head1 AUTHORS
43              
44             =over 4
45              
46             =item *
47              
48             Mickey Nasriachi <mickey@cpan.org>
49              
50             =item *
51              
52             Stevan Little <stevan@cpan.org>
53              
54             =item *
55              
56             Brian Fraser <hugmeir@cpan.org>
57              
58             =back
59              
60             =head1 COPYRIGHT AND LICENSE
61              
62             This software is copyright (c) 2019 by Mickey Nasriachi, Stevan Little, Brian Fraser.
63              
64             This is free software; you can redistribute it and/or modify it under
65             the same terms as the Perl 5 programming language system itself.
66              
67             =cut