Candy.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 2 / 2 totaltotal 100% 38 / 38 SCAR 11.0
CC
3
Cov
100%
redis_hash
2.0
redis_array
2.0
BEGIN
1.0
CRAP 3.0
« Candy/Hash.pm ↑ Summary
1 package Tie::Redis::Candy;
2  
3 # ABSTRACT: Tie Redis to HashRef or ArrayRef
4  
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Tie::Redis::Candy::Hash;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Tie::Redis::Candy::Array;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Exporter qw(import);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 our $VERSION = '1.000'; # VERSION
12  
13 2 our @EXPORT_OK = qw(redis_hash redis_array);
14  
15 sub redis_hash {
16 2 ▶ my ( $redis, $prefix, %init ) = @_;
Subroutine redis_hash: called CC=2 SCAR=6.9
Pod documented
17 2 tie( my %hash, 'Tie::Redis::Candy::Hash', $redis, $prefix );
18 2 $hash{$_} = delete $init{$_} for keys %init;
19 2 bless( \%hash, 'Tie::Redis::Candy::Hash' );
20 }
21  
22 sub redis_array {
23 2 ▶ my ( $redis, $listname, @init ) = @_;
Subroutine redis_array: called CC=2 SCAR=6.9
Pod documented
24 2 tie( my @array, 'Tie::Redis::Candy::Array', $redis, $listname );
25 2 ▶ while ( my $item = shift @init ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $item = shift @init) 4 2 6
26 4 push @array => $item;
27 }
28 2 bless( \@array, 'Tie::Redis::Candy::Array' );
29 }
30  
31 2 1;
32  
33 __END__
« Candy/Hash.pm ↑ Summary