| 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
| |||||||||||
| 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__ | ||||||||||