blib/lib/Web/ComposableRequest/Role/Compat.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 40 CC 1 SCAR 6.9
CC
1
Cov
0%
args
2.0
body_parameters
2.0
parameters
2.0
CRAP 2.0
1 package Web::ComposableRequest::Role::Compat;
2  
3 use Encode qw( decode );
4 use Web::ComposableRequest::Constants qw( FALSE TRUE );
5 use Moo::Role;
6  
7 requires qw( body_params query_params uri_params );
8  
9 sub args {
10 my $self = shift;
11  
12 return $self->uri_params->({ optional => TRUE, scrubber => FALSE });
13 }
14  
15 sub body_parameters {
16 my $self = shift;
17  
18 return $self->body_params->({
19 hashref => FALSE, optional => TRUE, scrubber => FALSE
20 });
21 }
22  
23 sub parameters {
24 my ($self, $options) = @_;
25  
26 return {
27 %{$self->query_parameters($options)}, %{$self->body_parameters($options)}
28 };
29 }
30  
31 sub query_parameters {
32 my $self = shift;
33  
34 return $self->query_params->({ optional => TRUE, scrubber => FALSE });
35 }
36  
37 use namespace::autoclean;
38  
39 1;
40  
41 __END__