Transaction/EPRAW/Base.pm

filter: Statementstmt 90.0% 18 / 20 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 2 / 2 totaltotal 89.6% 26 / 29 SCAR 6.9
CC
2
Cov
91%
line
2.0
_get_column
2.0
BEGIN
1.0
CRAP 2.0
« Transaction/EPPRC/Base.pm ↑ Summary Transaction/EPPRC/Detail/Chargeback.pm »
1 package Finance::AMEX::Transaction::EPRAW::Base;
2 7 $Finance::AMEX::Transaction::EPRAW::Base::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 # ABSTRACT: Parse AMEX Chargeback Notification Files (EPRAW) Base methods
7  
8 sub new {
9 40 ▶ my ($class, %props) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod documented
10 my $self = bless {
11 _line => $props{line},
12 40 }, $class;
13  
14 40 return $self;
15 }
16  
17 sub line {
18 0 ▶ my ($self) = @_;
Subroutine line: not called CC=1 SCAR=6.9
Pod documented
19 0 return $self->{_line};
20 }
21  
22 sub _get_column {
23 767 ▶ my ($self, $field) = @_;
Subroutine _get_column: called CC=2 SCAR=6.9
24 767 my $map = $self->field_map->{$field};
25  
26 # if the line is not long enough to handle the start of the field,
27 # it is an optional field that we don't have
28 767 ▶ if (length($self->{_line}) < $map->[0]) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $self->{"_line"} < $map->[0]) 1 766 767
29 1 return '';
30 }
31  
32 766 my $ret = substr($self->{_line}, $map->[0] - 1, $map->[1]);
33 766 $ret =~ s{\s+\z}{};
34 766 return $ret;
35 }
36  
37 7 1;
38  
39 __END__
« Transaction/EPPRC/Base.pm ↑ Summary Transaction/EPPRC/Detail/Chargeback.pm »