PONAPI/DAO/Request/Role/HasID.pm

filter: Statementstmt 100% 10 / 10 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 15 / 15 CC 2 SCAR 4.1
CC
2
Cov
100%
_validate_id
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« PONAPI/DAO/Request/RetrieveAll.pm ↑ Summary Test/PONAPI/Repository/MockDB/Loader.pm »
1 # ABSTRACT: DAO request role - `id`
2 package PONAPI::DAO::Request::Role::HasID;
3  
4 8 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 8 has id => (
7 is => 'ro',
8 isa => 'Str',
9 predicate => 'has_id',
10 );
11  
12 sub _validate_id {
13 169 ▶ my $self = shift;
Subroutine _validate_id: called CC=2 SCAR=6.9
14  
15 169 ▶ $self->_bad_request( "`id` is missing for this request" )
Branch: 1 branch
BranchTrueFalseTotal
unless $self->has_id 5 164 169
16 unless $self->has_id;
17 }
18  
19 8 ▶no Moose::Role; 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
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.003002
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) 2017 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
« PONAPI/DAO/Request/RetrieveAll.pm ↑ Summary Test/PONAPI/Repository/MockDB/Loader.pm »