File Coverage

blib/lib/DBM/Deep/Sector.pm
Criterion Covered Total %
statement 21 22 95.4
branch n/a
condition n/a
subroutine 10 12 83.3
pod 0 7 0.0
total 31 41 75.6


line stmt bran cond sub pod time code
1             package DBM::Deep::Sector;
2              
3 50     50   921 use 5.008_004;
  50         179  
4              
5 50     50   259 use strict;
  50         106  
  50         1237  
6 50     50   274 use warnings FATAL => 'all';
  50         204  
  50         1743  
7              
8 50     50   310 use Scalar::Util ();
  50         111  
  50         13483  
9              
10             sub new {
11 26481     26481 0 53033 my $self = bless $_[1], $_[0];
12 26481         85765 Scalar::Util::weaken( $self->{engine} );
13 26481         78068 $self->_init;
14 26481         113234 return $self;
15             }
16              
17       0     sub _init {}
18              
19             sub clone {
20 27     27 0 57 my $self = shift;
21 27         76 return ref($self)->new({
22             engine => $self->engine,
23             type => $self->type,
24             data => $self->data,
25             });
26             }
27              
28              
29 203519     203519 0 513159 sub engine { $_[0]{engine} }
30 121106     121106 0 329314 sub offset { $_[0]{offset} }
31 8878     8878 0 28609 sub type { $_[0]{type} }
32 8440     8440 0 25514 sub staleness { $_[0]{staleness} }
33              
34 0     0 0   sub load { die "load must be implemented in a child class" }
35              
36             1;
37             __END__