blib/lib/MooseX/Role/MissingMethodUtils.pm

filter: Statementstmt 79.1% 19 / 24 Branchbran 30.0% 3 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 69.2% 27 / 39 CC 6 SCAR 14.6
CC
6
Cov
65%
can
6.8
AUTOLOAD
3.1
BEGIN
1.0
CRAP 4.3
↑ Summary
1 package MooseX::Role::MissingMethodUtils;
2 {
3 3 $MooseX::Role::MissingMethodUtils::VERSION = '0.02';
4 }
5  
6 3 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 sub AUTOLOAD
9 2 ▶{
Subroutine AUTOLOAD: called CC=3 SCAR=11.4
10 2 my ($self, @params) = @_;
11 2 my ($name) = our $AUTOLOAD =~ /::(\w+)$/;
12  
13 2 my $meth_ref = $self->can('method_missing');
14  
15 2 ▶ if ( $meth_ref )
Branch: 1 branch
BranchTrueFalseTotal
if ($meth_ref) 2 0 2
16 {
17 2 @_ = ($self, $name, @params);
18  
19 2 ▶ goto &{$meth_ref} if $meth_ref;
Branch: 1 branch
BranchTrueFalseTotal
if $meth_ref 2 0 2
20 }
21  
22 0 return;
23 }
24  
25 sub can
26 4 ▶{
Subroutine can: called CC=4 SCAR=19.2
Pod documented
27 4 my ($self, $method) = @_;
28  
29 4 my $meth_ref = $self->SUPER::can( $method );
30
31 4 ▶ return $meth_ref if $meth_ref;
Branch: 1 branch
BranchTrueFalseTotal
if $meth_ref 4 0 4
32  
33 0 ▶ if ( $self->can("responds_to") )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->can("responds_to")) 0 0 0
34 {
35 0 ▶ if ( my $meth_ref = $self->responds_to($method) )
Branch: 1 branch
BranchTrueFalseTotal
if (my $meth_ref = $self->responds_to($method)) 0 0 0
36 {
37 3 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
38 0 return *{ $method } = $meth_ref;
39 }
40 }
41 }
42  
43 3 1;
44  
45 # ABSTRACT: Getting rid of boilerplate AUTOLOAD stuff
46  
47  
48  
49  
50 __END__
↑ Summary