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   894 use 5.008_004;
  50         188  
4              
5 50     50   291 use strict;
  50         106  
  50         1234  
6 50     50   288 use warnings FATAL => 'all';
  50         154  
  50         1865  
7              
8 50     50   323 use Scalar::Util ();
  50         114  
  50         13378  
9              
10             sub new {
11 26481     26481 0 53969 my $self = bless $_[1], $_[0];
12 26481         80764 Scalar::Util::weaken( $self->{engine} );
13 26481         75470 $self->_init;
14 26481         106497 return $self;
15             }
16              
17       0     sub _init {}
18              
19             sub clone {
20 27     27 0 80 my $self = shift;
21 27         68 return ref($self)->new({
22             engine => $self->engine,
23             type => $self->type,
24             data => $self->data,
25             });
26             }
27              
28              
29 203538     203538 0 477464 sub engine { $_[0]{engine} }
30 121117     121117 0 306955 sub offset { $_[0]{offset} }
31 8878     8878 0 28061 sub type { $_[0]{type} }
32 8440     8440 0 23328 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__