File Coverage

blib/lib/List/Objects/WithUtils/Hash/Inflated/RW.pm
Criterion Covered Total %
statement 19 19 100.0
branch 8 8 100.0
condition n/a
subroutine 5 5 100.0
pod n/a
total 32 32 100.0


line stmt bran cond sub pod time code
1             package List::Objects::WithUtils::Hash::Inflated::RW;
2             $List::Objects::WithUtils::Hash::Inflated::RW::VERSION = '2.028002';
3 1     1   420 use strictures 2;
  1         4  
  1         29  
4 1     1   124 use Carp ();
  1         1  
  1         10  
5 1     1   3 use Scalar::Util ();
  1         1  
  1         12  
6              
7 1     1   7 use parent 'List::Objects::WithUtils::Hash::Inflated';
  1         2  
  1         3  
8              
9             our $AUTOLOAD;
10             sub AUTOLOAD {
11 6     6   645 my $self = shift;
12 6         22 ( my $method = $AUTOLOAD ) =~ s/.*:://;
13 6 100       118 Scalar::Util::blessed($self)
14             or Carp::confess "Not a class method: '$method'";
15              
16             Carp::confess "Can't locate object method '$method'"
17 5 100       88 unless exists $self->{$method};
18 4 100       12 return $self->{$method} unless @_;
19 2 100       76 Carp::confess "Multiple arguments passed to setter '$method'"
20             if @_ > 1;
21 1         3 $self->{$method} = $_[0]
22             }
23              
24             1;
25              
26             =pod
27              
28             =for Pod::Coverage AUTOLOAD
29              
30             =cut