File Coverage

blib/lib/DWH_File/Work.pm
Criterion Covered Total %
statement 25 25 100.0
branch 1 2 50.0
condition n/a
subroutine 8 8 100.0
pod 0 2 0.0
total 34 37 91.8


line stmt bran cond sub pod time code
1             package DWH_File::Work;
2              
3 9     9   55 use warnings;
  9         19  
  9         450  
4 9     9   47 use strict;
  9         11  
  9         298  
5 9     9   43 use vars qw( @ISA $VERSION );
  9         16  
  9         467  
6              
7 9     9   8536 use DWH_File::Kernel;
  9         33  
  9         123  
8 9     9   364 use DWH_File::Tie::Hash;
  9         22  
  9         306  
9              
10             @ISA = qw( DWH_File::Tie::Hash );
11             $VERSION = 0.01;
12              
13             sub TIEHASH {
14 13     13   49 my $class = shift;
15 13         134 my $kernel = DWH_File::Kernel->new( @_ );
16 13         67 my $self = delete $kernel->{ work };
17 13         85 $kernel->{ cache }->decache( $self );
18 13         208 return $self;
19             }
20              
21             sub tie_reference {
22 13     13 0 44 my $this = shift;
23 13         81 $_[ 5 ] = 'DWH_File::Tie::Hash';
24 13         429 return $this->SUPER::tie_reference( @_ );
25             }
26              
27             sub wipe {
28 13 50   13 0 99 if ( $_[ 0 ]->{ kernel }{ alive } ) {
29 13         95 $_[ 0 ]->{ kernel }->wipe;
30             }
31             }
32              
33             1;
34              
35             __END__