File Coverage

blib/lib/Thunderhorse/Autoloadable.pm
Criterion Covered Total %
statement 24 24 100.0
branch 6 6 100.0
condition 3 3 100.0
subroutine 4 4 100.0
pod 0 1 0.0
total 37 38 97.3


line stmt bran cond sub pod time code
1             package Thunderhorse::Autoloadable;
2             $Thunderhorse::Autoloadable::VERSION = '0.102';
3 21     21   15808 use v5.40;
  21         96  
4 21     21   142 use Mooish::Base -standard, -role;
  21         60  
  21         307  
5              
6             requires qw(
7             _run_method
8             _can_method
9             );
10              
11 145         234 sub AUTOLOAD ($self, @args)
12 145     145   48753 {
  145         410  
  145         376  
13 145         229 our $AUTOLOAD;
14              
15 145         189 state %methods;
16 145   100     578 my $method = $methods{$AUTOLOAD} //= do {
17 109         790 my $wanted = $AUTOLOAD =~ s{^(.+)::}{}r;
18 109 100       1150 return if $wanted eq 'DESTROY';
19 13         79 $wanted;
20             };
21              
22 49         303 $self->_run_method($method, @args);
23             }
24              
25 649         1187 sub can ($self, $method)
26 649     649 0 552484 {
  649         1155  
  649         928  
27 649         4483 my $I_can = $self->SUPER::can($method);
28 649 100       2707 return $I_can if $I_can;
29              
30 166 100       553 return undef unless ref $self;
31 63         316 return $self->_can_method($method);
32             }
33