| 1 | package Finance::Bank::Wachovia::Transaction; | ||||||||||
| 2 | |||||||||||
| 3 | 4 | ▶ | use Finance::Bank::Wachovia::ErrorHandler; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 4 | our $VERSION = '0.3'; | |||||||||
| 8 | 4 | our @ISA = qw/Finance::Bank::Wachovia::ErrorHandler/; | |||||||||
| 9 | 4 | my @attrs; | |||||||||
| 10 | |||||||||||
| 11 | BEGIN{ | ||||||||||
| 12 | 4 | ▶ | @attrs = qw( | ||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=6.9
| |||||||||||
| 13 | date | ||||||||||
| 14 | action | ||||||||||
| 15 | description | ||||||||||
| 16 | withdrawal_amount | ||||||||||
| 17 | deposit_amount | ||||||||||
| 18 | balance | ||||||||||
| 19 | seq_no | ||||||||||
| 20 | trans_code | ||||||||||
| 21 | check_num | ||||||||||
| 22 | ); | ||||||||||
| 23 | |||||||||||
| 24 | 4 | my $x = @__SUPER__::ATTRIBUTES; | |||||||||
| 25 | 4 | for( @attrs ){ | |||||||||
| 26 | 36 | ▶ | eval "sub _$_ { $x }"; | ||||||||
|
Subroutine
_action: called CC=1 SCAR=0.0
Subroutine
_balance: called CC=1 SCAR=0.0
Subroutine
_check_num: called CC=1 SCAR=0.0
Subroutine
_date: called CC=1 SCAR=0.0
Subroutine
_deposit_amount: called CC=1 SCAR=0.0
Subroutine
_description: called CC=1 SCAR=0.0
Subroutine
_seq_no: called CC=1 SCAR=0.0
Subroutine
_trans_code: called CC=1 SCAR=0.0
Subroutine
_withdrawal_amount: called CC=1 SCAR=0.0
| |||||||||||
| 27 | 36 | $x++; | |||||||||
| 28 | } | ||||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | sub new { | ||||||||||
| 32 | 149 | ▶ | my($class, %attrs) = @_; | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 33 | 149 | my $self = []; | |||||||||
| 34 | 149 | bless $self, $class; | |||||||||
| 35 | 149 | foreach my $att ( keys %attrs ){ | |||||||||
| 36 | 1332 | $self->$att( $attrs{$att} ); | |||||||||
| 37 | } | ||||||||||
| 38 | 149 | return $self; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | sub AUTOLOAD { | ||||||||||
| 42 | 4 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 43 | 1346 | ▶ | our $AUTOLOAD; | ||||||||
|
Subroutine
AUTOLOAD: called CC=3 SCAR=11.0
| |||||||||||
| 44 | 1346 | my $self = shift; | |||||||||
| 45 | 1346 | my $attr = lc $AUTOLOAD; | |||||||||
| 46 | 1346 | $attr =~ s/.*:://; | |||||||||
| 47 | 1346 | ▶ | die "$attr not a valid attribute" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | unless grep /$attr/, @attrs; | ||||||||||
| 49 | # get if no args passed | ||||||||||
| 50 | 1346 | ▶ | return $self->[ &{"_$attr"} ] unless @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 51 | # set if args passed | ||||||||||
| 52 | 1340 | $self->[ &{"_$attr"} ] = shift; | |||||||||
| 53 | 1340 | return $self; | |||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | ▶ | sub DESTROY {} | |||||||||
|
Subroutine
DESTROY: not called CC=1 SCAR=0.0
| |||||||||||
| 57 | |||||||||||
| 58 | __END__ | ||||||||||