File Coverage

blib/lib/PONAPI/DAO/Request/Role/HasID.pm
Criterion Covered Total %
statement 8 8 100.0
branch 2 2 100.0
condition n/a
subroutine 3 3 100.0
pod n/a
total 13 13 100.0


line stmt bran cond sub pod time code
1             # ABSTRACT: DAO request role - `id`
2             package PONAPI::DAO::Request::Role::HasID;
3              
4 8     8   4333 use Moose::Role;
  8         27  
  8         52  
5              
6             has id => (
7             is => 'ro',
8             isa => 'Str',
9             predicate => 'has_id',
10             );
11              
12             sub _validate_id {
13 169     169   330 my $self = shift;
14              
15 169 100       5905 $self->_bad_request( "`id` is missing for this request" )
16             unless $self->has_id;
17             }
18              
19 8     8   40842 no Moose::Role; 1;
  8         21  
  8         36  
20              
21             __END__
22              
23             =pod
24              
25             =encoding UTF-8
26              
27             =head1 NAME
28              
29             PONAPI::DAO::Request::Role::HasID - DAO request role - `id`
30              
31             =head1 VERSION
32              
33             version 0.003003
34              
35             =head1 AUTHORS
36              
37             =over 4
38              
39             =item *
40              
41             Mickey Nasriachi <mickey@cpan.org>
42              
43             =item *
44              
45             Stevan Little <stevan@cpan.org>
46              
47             =item *
48              
49             Brian Fraser <hugmeir@cpan.org>
50              
51             =back
52              
53             =head1 COPYRIGHT AND LICENSE
54              
55             This software is copyright (c) 2019 by Mickey Nasriachi, Stevan Little, Brian Fraser.
56              
57             This is free software; you can redistribute it and/or modify it under
58             the same terms as the Perl 5 programming language system itself.
59              
60             =cut