Any/Impl/MojoUserAgent.pm untested

filter: Statementstmt 0.0% 0 / 37 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 55 CC 4 SCAR 14.3
CC
4
Cov
0%
call
6.0
call_cb
6.0
call_p
6.0
CRAP 4.2
1 package UserAgent::Any::Impl::MojoUserAgent;
2  
3 use 5.036;
4  
5 use Moo;
6 use UserAgent::Any::Impl::Helper ':all';
7  
8 use namespace::clean;
9  
10 with 'UserAgent::Any::Impl';
11  
12 our $VERSION = 0.01;
13  
14 sub call {
15 my ($self, $method, $url, $params, $content) = &get_call_args;
16 return new_response($self->{ua}
17 ->$method($url, params_to_hash(@{$params}), (defined ${$content} ? ${$content} : ()))->res);
18 }
19  
20 sub call_cb {
21 my ($self, $method, $url, $params, $content) = &get_call_args;
22 return sub ($cb) {
23 $self->{ua}->$method(
24 $url,
25 params_to_hash(@{$params}),
26 (defined ${$content} ? ${$content} : ()),
27 sub ($, $tx) { $cb->(new_response($tx->res)) });
28 return;
29 };
30 }
31  
32 sub call_p {
33 my ($self, $method, $url, $params, $content) = &get_call_args;
34 return $self->{ua}->${\"${method}_p"}
35 ($url, params_to_hash(@{$params}), (defined ${$content} ? ${$content} : ()))
36 ->then(sub ($tx) { new_response($tx->res) });
37 }
38  
39 BEGIN { generate_methods() }
40  
41 1;
42  
43 __END__