File Coverage

blib/lib/ResourcePool/Factory/Redis.pm
Criterion Covered Total %
statement 22 22 100.0
branch n/a
condition 1 3 33.3
subroutine 6 6 100.0
pod 2 2 100.0
total 31 33 93.9


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2              
3             package ResourcePool::Factory::Redis;
4 1     1   83842 use strict;
  1         3  
  1         35  
5 1     1   6 use warnings;
  1         2  
  1         37  
6 1     1   4 use base qw(ResourcePool::Factory);
  1         13  
  1         873  
7 1     1   6556 use ResourcePool::Resource::Redis;
  1         4  
  1         171  
8              
9             our $VERSION = 1.0;
10              
11             sub new {
12 1     1 1 334 my $proto = shift;
13 1   33     7 my $class = ref($proto) || $proto;
14 1         11 my $self = $class->SUPER::new("Redis");
15 1         15 my %args = @_;
16              
17 1         8 $self->{'args'} = \%args;
18              
19 1         3 bless($self, $class);
20 1         3 return $self;
21             }
22              
23             sub create_resource {
24 1     1 1 782 my ($self) = @_;
25 1         2 return ResourcePool::Resource::Redis->new(%{$self->{'args'}});
  1         11  
26             }
27              
28             __END__