CHI/Driver/Role/Universal.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 29 / 29 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« CHI/Driver/Role/IsSubcache.pm ↑ Summary CHI/Test/Driver/NonMoose.pm »
1 package CHI::Driver::Role::Universal;
2 19 $CHI::Driver::Role::Universal::VERSION = '0.60';
3 19 ▶use CHI::Constants qw(CHI_Meta_Namespace);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 19 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 19 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 19 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 around 'get_namespaces' => sub {
9 92 ▶ my $orig = shift;
Subroutine __ANON__: called CC=1 SCAR=0.0
10 92 my $self = shift;
11  
12 # Call driver get_namespaces, then filter out meta-namespace
13 92 return grep { $_ ne CHI_Meta_Namespace } $self->$orig(@_);
14 19 };
15  
16 19 foreach my $method (qw(remove append)) {
17 around $method => sub {
18 1683 ▶ my ( $orig, $self, $key, @rest ) = @_;
Subroutine __ANON__: called CC=1 SCAR=0.0
19  
20 # Call transform_key before passing to method
21 1683 return $self->$orig( $self->transform_key($key), @rest );
22 38 };
23 }
24  
25 19 1;
26  
27 __END__
« CHI/Driver/Role/IsSubcache.pm ↑ Summary CHI/Test/Driver/NonMoose.pm »