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   67223 use warnings;
  5         7  
  5         167  
5 5     5   22 use strict;
  5         7  
  5         151  
6 5     5   2243 use Class::Load ();
  5         121951  
  5         605  
7              
8             our $VERSION = '0.924'; # VERSION
9              
10             sub new {
11 5     5 1 1851 my $class = shift;
12              
13 5 100 66     52 my %data = ref $_[0] && ref $_[0] eq 'HASH' ? %{ $_[0] } : @_;
  1         5  
14              
15 5         16 my $gateway = delete $data{gateway};
16 5         16 my $gateway_class = "Business::CPI::Gateway::$gateway";
17              
18 5         28 Class::Load::load_class($gateway_class);
19              
20 5         361 return $gateway_class->new(%data);
21             }
22              
23             1;
24              
25             __END__