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   75252 use warnings;
  5         11  
  5         186  
5 5     5   24 use strict;
  5         6  
  5         159  
6 5     5   3194 use Class::Load ();
  5         141356  
  5         676  
7              
8             our $VERSION = '0.923'; # VERSION
9              
10             sub new {
11 5     5 1 886 my $class = shift;
12              
13 5 100 66     53 my %data = ref $_[0] && ref $_[0] eq 'HASH' ? %{ $_[0] } : @_;
  1         4  
14              
15 5         17 my $gateway = delete $data{gateway};
16 5         14 my $gateway_class = "Business::CPI::Gateway::$gateway";
17              
18 5         28 Class::Load::load_class($gateway_class);
19              
20 5         319 return $gateway_class->new(%data);
21             }
22              
23             1;
24              
25             __END__