File Coverage

blib/lib/Devel/Memalyzer/Base.pm
Criterion Covered Total %
statement 20 20 100.0
branch 2 2 100.0
condition n/a
subroutine 6 6 100.0
pod 0 2 0.0
total 28 30 93.3


line stmt bran cond sub pod time code
1             package Devel::Memalyzer::Base;
2 11     11   210602 use strict;
  11         28  
  11         325  
3 11     11   54 use warnings;
  11         22  
  11         1134  
4              
5             sub gen_accessors {
6 13     13 0 30 my $class = shift;
7 13         48 for my $accessor ( @_ ) {
8             my $sub = sub {
9 174     174   394 my $self = shift;
10 174 100       668 ($self->{ $accessor }) = @_ if @_;
11 174         17424158 return $self->{ $accessor };
12 35         164 };
13 11     11   81 no strict 'refs';
  11         24  
  11         1192  
14 35         48 *{ $class . '::' . $accessor } = $sub;
  35         206  
15             }
16             }
17              
18             sub new {
19 36     36 0 8282 my $class = shift;
20 36         129 my %proto = @_;
21 36         361 return bless( \%proto, $class );
22             }
23              
24             1;
25              
26             __END__