Plagger/CacheProxy.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 27 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
path_to
2.0
cookie_jar
2.0
CRAP 2.0
1 package Plagger::CacheProxy;
2 use strict;
3  
4 sub new {
5 my($class, $plugin, $cache) = @_;
6 bless {
7 namespace => $plugin->plugin_id,
8 cache => $cache,
9 }, $class;
10 }
11  
12 no strict 'refs';
13 for my $meth (qw(get get_callback set remove)) {
14 *{$meth} = sub {
15 my $self = shift;
16 my $key = shift;
17 $key = "$self->{namespace}|$key";
18 $self->{cache}->$meth($key, @_);
19 };
20 }
21  
22 sub path_to {
23 my($self, @path) = @_;
24 $self->{cache}->path_to($self->{namespace}, @path);
25 }
26  
27 sub cookie_jar {
28 my $self = shift;
29 $self->{cache}->cookie_jar($self->{namespace});
30 }
31  
32 1;