File Coverage

blib/lib/List/Objects/WithUtils/Hash/Inflated.pm
Criterion Covered Total %
statement 27 28 96.4
branch 11 12 91.6
condition n/a
subroutine 8 9 88.8
pod 0 3 0.0
total 46 52 88.4


line stmt bran cond sub pod time code
1             package List::Objects::WithUtils::Hash::Inflated;
2             $List::Objects::WithUtils::Hash::Inflated::VERSION = '2.027002';
3 2     2   1540 use strictures 2;
  2         15  
  2         128  
4 2     2   494 use Carp ();
  2         4  
  2         33  
5 2     2   11 use Scalar::Util ();
  2         4  
  2         822  
6              
7             sub new {
8 3     3 0 25 bless +{ @_[1 .. $#_] }, $_[0]
9             }
10              
11 1     1 0 457 sub DEFLATE { %{ $_[0] } }
  1         7  
12              
13             our $AUTOLOAD;
14              
15             sub can {
16 7     7 0 16 my ($self, $method) = @_;
17 7 100       48 if (my $sub = $self->SUPER::can($method)) {
18 1         5 return $sub
19             }
20 6 100       88 return unless exists $self->{$method};
21             sub {
22 1     1   267 my ($self) = @_;
23 1 50       7 if (my $sub = $self->SUPER::can($method)) {
24 0         0 goto $sub
25             }
26 1         2 $AUTOLOAD = $method;
27 1         4 goto &AUTOLOAD
28             }
29 1         5 }
30              
31             sub AUTOLOAD {
32 8     8   1384 my $self = shift;
33 8         41 ( my $method = $AUTOLOAD ) =~ s/.*:://;
34 8 100       212 Scalar::Util::blessed($self)
35             or Carp::confess "Not a class method: '$method'";
36            
37             Carp::confess "Can't locate object method '$method'"
38 7 100       237 unless exists $self->{$method};
39 6 100       128 Carp::confess "Accessor '$method' is read-only"
40             if @_;
41              
42 5         30 $self->{$method}
43             }
44              
45       0     sub DESTROY {}
46              
47             1;
48              
49             =pod
50              
51             =for Pod::Coverage new can AUTOLOAD DEFLATE
52              
53             =cut