Transaction/CBNOT.pm

filter: Statementstmt 96.6% 29 / 30 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 2 / 2 totaltotal 95.4% 42 / 44 SCAR 11.0
CC
3
Cov
94%
parse_line
3.1
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« Transaction.pm ↑ Summary Transaction/EPTRN/Base.pm »
1 package Finance::AMEX::Transaction::CBNOT;
2 7 $Finance::AMEX::Transaction::CBNOT::VERSION = '0.003';
3 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 7 ▶use Finance::AMEX::Transaction::CBNOT::Header;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 7 ▶use Finance::AMEX::Transaction::CBNOT::Detail;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 7 ▶use Finance::AMEX::Transaction::CBNOT::Trailer;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 7 ▶use Finance::AMEX::Transaction::CBNOT::Unknown;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 # ABSTRACT: Parse AMEX Chargeback Notification Files (CBNOT)
12  
13 sub new {
14 2 ▶ my ($class, %props) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod documented
15  
16 2 my $type_map = {
17 H => 'Finance::AMEX::Transaction::CBNOT::Header',
18 D => 'Finance::AMEX::Transaction::CBNOT::Detail',
19 T => 'Finance::AMEX::Transaction::CBNOT::Trailer',
20 };
21  
22 2 my $self = bless {
23 _type_map => $type_map,
24 }, $class;
25  
26 2 return $self;
27 }
28  
29 sub parse_line {
30 8 ▶ my ($self, $line) = @_;
Subroutine parse_line: called CC=3 SCAR=11.2
Pod documented
31  
32 8 ▶ return if not defined $line;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $line 2 6 8
33  
34 6 my $indicator = substr($line, 0, 1);
35 6 ▶ if (exists $self->{_type_map}->{$indicator}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{"_type_map"}{$indicator}) 6 0 6
36 6 return $self->{_type_map}->{$indicator}->new(line => $line);
37 }
38 0 return Finance::AMEX::Transaction::CBNOT::Unknown->new(line => $line);
39 }
40  
41 7 1;
42  
43 __END__
« Transaction.pm ↑ Summary Transaction/EPTRN/Base.pm »