File Coverage

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