blib/lib/Plack/Session/Store/RedisFast/Encoder/Custom.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 29 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
encode
2.0
decode
2.0
CRAP 2.0
1 package Plack::Session::Store::RedisFast::Encoder::Custom;
2  
3 use strict;
4 use warnings;
5  
6 use 5.008_005;
7  
8 use Plack::Util::Accessor qw( inflate deflate );
9  
10 sub new {
11 my ( $class, $inflate, $deflate ) = @_;
12 return bless {
13 inflate => $inflate,
14 deflate => $deflate,
15 }, $class;
16 }
17  
18 sub encode {
19 my ( $self, $thing ) = @_;
20  
21 $self->inflate->($thing);
22 }
23  
24 sub decode {
25 my ( $self, $bytes ) = @_;
26  
27 $self->deflate->($bytes);
28 }
29  
30 1;
31  
32 __END__