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