File Coverage

blib/lib/ResourcePool/Factory/DBI.pm
Criterion Covered Total %
statement 24 24 100.0
branch 1 2 50.0
condition 2 3 66.6
subroutine 6 6 100.0
pod 2 2 100.0
total 35 37 94.5


line stmt bran cond sub pod time code
1             #*********************************************************************
2             #*** ResourcePool::Factory::DBI
3             #*** Copyright (c) 2004 by Markus Winand
4             #*** $Id: DBI.pm,v 1.4 2004/05/02 07:48:58 mws Exp $
5             #*********************************************************************
6              
7             package ResourcePool::Factory::DBI;
8              
9 4     4   171669 use vars qw($VERSION @ISA);
  4         9  
  4         227  
10 4     4   19 use strict;
  4         7  
  4         116  
11 4     4   2210 use ResourcePool::Resource::DBI;
  4         12  
  4         105  
12 4     4   3411 use ResourcePool::Factory;
  4         15089  
  4         737  
13              
14             $VERSION = "1.0101";
15             push @ISA, "ResourcePool::Factory";
16              
17             sub new($$$$$) {
18 31     31 1 4281 my $proto = shift;
19 31   66     291 my $class = ref($proto) || $proto;
20 31         127 my $self = $class->SUPER::new("DBI");
21              
22 31 50       511 if (! exists($self->{DS})) {
23 31         57 $self->{DS} = shift;
24 31         56 $self->{user} = shift;
25 31         40 $self->{auth} = shift;
26 31         49 $self->{attr} = shift;
27             }
28              
29 31         64 bless($self, $class);
30              
31 31         311 return $self;
32             }
33              
34             sub create_resource($) {
35 2     2 1 9 my ($self) = @_;
36 2         13 return ResourcePool::Resource::DBI->new(
37             $self->{DS}
38             , $self->{user}
39             , $self->{auth}
40             , $self->{attr}
41             );
42             }
43              
44             1;