File Coverage

lib/Badger/Codec/Storable.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 4 4 100.0
total 22 22 100.0


line stmt bran cond sub pod time code
1             #========================================================================
2             #
3             # Badger::Codec::Storable
4             #
5             # DESCRIPTION
6             # Codec for encoding/decoding data via the Storable module.
7             #
8             # AUTHOR
9             # Andy Wardley
10             #
11             #========================================================================
12              
13             package Badger::Codec::Storable;
14              
15             use Badger::Class
16 4         29 version => 0.01,
17 4     4   5051 base => 'Badger::Codec';
  4         8  
18              
19 4     4   2667 use Storable qw( freeze thaw );
  4         13776  
  4         620  
20              
21             sub encode {
22 12     12 1 45 my $self = shift;
23 12         37 freeze(@_);
24             }
25              
26             sub decode {
27 12     12 1 57 my $self = shift;
28 12         33 thaw(@_);
29             }
30              
31             # shortcuts straight to the real encoder/decoder subs for efficient aliasing
32              
33             sub encoder {
34 4     4 1 15 \&freeze;
35             }
36              
37             sub decoder {
38 4     4 1 17 \&thaw;
39             }
40              
41              
42             1;
43              
44             __END__