Transaction/EPTRN/Base.pm

filter: Statementstmt 85.0% 17 / 20 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 2 / 2 totaltotal 82.7% 24 / 29 SCAR 7.1
CC
2
Cov
82%
_get_column
2.0
line
2.0
BEGIN
1.0
CRAP 2.0
« Transaction/CBNOT.pm ↑ Summary Transaction/EPPRC/Base.pm »
1 package Finance::AMEX::Transaction::EPTRN::Base;
2 7 $Finance::AMEX::Transaction::EPTRN::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 Transaction/Invoice Level Reconciliation (EPTRN)
7  
8 sub new {
9 5 ▶ my ($class, %props) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod documented
10 my $self = bless {
11 _line => $props{line},
12 5 }, $class;
13  
14 5 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 82 ▶ my ($self, $field) = @_;
Subroutine _get_column: called CC=2 SCAR=7.1
24 82 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 82 ▶ if (length($self->{_line}) < $map->[0]) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $self->{"_line"} < $map->[0]) 0 82 82
29 0 return '';
30 }
31  
32 82 my $ret = substr($self->{_line}, $map->[0] - 1, $map->[1]);
33 82 $ret =~ s{\s+\z}{};
34 82 return $ret;
35 }
36  
37 7 1;
38  
39 __END__
« Transaction/CBNOT.pm ↑ Summary Transaction/EPPRC/Base.pm »