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.027002';
3 1     1   833 use strictures 2;
  1         6  
  1         84  
4 1     1   229 use Carp ();
  1         2  
  1         17  
5 1     1   6 use Scalar::Util ();
  1         2  
  1         22  
6              
7 1     1   6 use parent 'List::Objects::WithUtils::Hash::Inflated';
  1         2  
  1         8  
8              
9             our $AUTOLOAD;
10             sub AUTOLOAD {
11 6     6   1126 my $self = shift;
12 6         36 ( my $method = $AUTOLOAD ) =~ s/.*:://;
13 6 100       216 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       235 unless exists $self->{$method};
18 4 100       19 return $self->{$method} unless @_;
19 2 100       143 Carp::confess "Multiple arguments passed to setter '$method'"
20             if @_ > 1;
21 1         7 $self->{$method} = $_[0]
22             }
23              
24             1;
25              
26             =pod
27              
28             =for Pod::Coverage AUTOLOAD
29              
30             =cut