File Coverage

blib/lib/Business/CPI.pm
Criterion Covered Total %
statement 16 16 100.0
branch 2 2 100.0
condition 2 3 66.6
subroutine 4 4 100.0
pod 1 1 100.0
total 25 26 96.1


line stmt bran cond sub pod time code
1             package Business::CPI;
2             # ABSTRACT: Common Payment Interface
3              
4 5     5   60622 use warnings;
  5         9  
  5         202  
5 5     5   24 use strict;
  5         8  
  5         148  
6 5     5   2234 use Class::Load ();
  5         128134  
  5         629  
7              
8             our $VERSION = '0.922'; # VERSION
9              
10             sub new {
11 5     5 1 848 my $class = shift;
12              
13 5 100 66     46 my %data = ref $_[0] && ref $_[0] eq 'HASH' ? %{ $_[0] } : @_;
  1         5  
14              
15 5         17 my $gateway = delete $data{gateway};
16 5         14 my $gateway_class = "Business::CPI::Gateway::$gateway";
17              
18 5         24 Class::Load::load_class($gateway_class);
19              
20 5         278 return $gateway_class->new(%data);
21             }
22              
23             1;
24              
25             __END__