line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::Bank::Wachovia::Credit; |
2
|
3
|
|
|
3
|
|
1052
|
use Finance::Bank::Wachovia::ErrorHandler; |
|
3
|
|
|
|
|
25
|
|
|
3
|
|
|
|
|
86
|
|
3
|
3
|
|
|
3
|
|
16
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
98
|
|
4
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
387
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my @attrs; |
7
|
|
|
|
|
|
|
our @ISA = qw/Finance::Bank::Wachovia::ErrorHandler/; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
BEGIN{ |
10
|
3
|
|
|
3
|
|
11
|
@attrs = qw( |
11
|
|
|
|
|
|
|
name |
12
|
|
|
|
|
|
|
number |
13
|
|
|
|
|
|
|
type |
14
|
|
|
|
|
|
|
current_balance |
15
|
|
|
|
|
|
|
available_credit |
16
|
|
|
|
|
|
|
limit |
17
|
|
|
|
|
|
|
data_obtainer |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
3
|
|
|
|
|
6
|
my $x = @__SUPER__::ATTRIBUTES; |
21
|
3
|
|
|
|
|
6
|
for( @attrs ){ |
22
|
21
|
|
|
3
|
|
702
|
eval "sub _$_ { $x }"; |
|
3
|
|
|
7
|
|
14
|
|
|
7
|
|
|
7
|
|
85
|
|
|
7
|
|
|
2
|
|
34
|
|
|
2
|
|
|
3
|
|
9
|
|
|
3
|
|
|
10
|
|
13
|
|
|
10
|
|
|
6
|
|
56
|
|
|
6
|
|
|
|
|
43
|
|
23
|
21
|
|
|
|
|
446
|
$x++; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub new { |
28
|
2
|
|
|
2
|
0
|
21
|
my($class, %attrs) = @_; |
29
|
2
|
|
|
|
|
5
|
my $self = []; |
30
|
2
|
|
|
|
|
7
|
bless $self, $class; |
31
|
2
|
|
|
|
|
8
|
foreach my $att ( keys %attrs ){ |
32
|
4
|
|
|
|
|
44
|
$self->$att( $attrs{$att} ); |
33
|
|
|
|
|
|
|
} |
34
|
2
|
50
|
|
|
|
11
|
return Finance::Bank::Wachovia::Credit->Error("no account number set in Finance::Bank::Wachovia::Credit->new") |
35
|
|
|
|
|
|
|
unless $self->number; |
36
|
2
|
|
|
|
|
12
|
return $self; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub AUTOLOAD { |
40
|
3
|
|
|
3
|
|
37
|
no strict 'refs'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
2197
|
|
41
|
17
|
|
|
17
|
|
24
|
our $AUTOLOAD; |
42
|
17
|
|
|
|
|
23
|
my $self = shift; |
43
|
17
|
|
|
|
|
32
|
my $attr = lc $AUTOLOAD; |
44
|
17
|
|
|
|
|
70
|
$attr =~ s/.*:://; |
45
|
17
|
50
|
|
|
|
222
|
return $self->Error( "$attr not a valid attribute" ) |
46
|
|
|
|
|
|
|
unless grep /$attr/, @attrs; |
47
|
|
|
|
|
|
|
# get if no args passed |
48
|
17
|
100
|
|
|
|
41
|
return $self->[ &{"_$attr"} ] unless @_; |
|
13
|
|
|
|
|
374
|
|
49
|
|
|
|
|
|
|
# set if args passed |
50
|
4
|
|
|
|
|
16
|
$self->[ &{"_$attr"} ] = shift; |
|
4
|
|
|
|
|
128
|
|
51
|
4
|
|
|
|
|
10
|
return $self; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
2
|
|
|
2
|
1
|
6
|
sub balance { current_balance(@_) } |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# these values are loaded on-demand |
58
|
|
|
|
|
|
|
sub limit { |
59
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
60
|
1
|
50
|
|
|
|
9
|
if(@_){ $self->[ _limit ] = shift; return $self; } |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
61
|
1
|
50
|
|
|
|
41
|
return $self->[ _limit ] if $self->[ _limit ]; |
62
|
1
|
|
|
|
|
7
|
my $do = $self->data_obtainer(); |
63
|
1
|
|
|
|
|
7
|
my $limit = $do->get_credit_account_limit( $self->number() ); |
64
|
1
|
|
|
|
|
28
|
$self->[ _limit ] = $limit; |
65
|
1
|
|
|
|
|
5
|
return $limit; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub name { |
70
|
1
|
|
|
1
|
1
|
559
|
my $self = shift; |
71
|
1
|
50
|
|
|
|
5
|
if(@_){ $self->[ _name ] = shift; return $self; } |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
72
|
1
|
50
|
|
|
|
32
|
return $self->[ _name ] if $self->[ _name ]; |
73
|
1
|
|
|
|
|
5
|
$self->[ _name ] = $self->data_obtainer->get_account_name( $self->number ); |
74
|
1
|
|
|
|
|
27
|
return $self->[ _name ]; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub type { |
78
|
3
|
|
|
3
|
1
|
5
|
my $self = shift; |
79
|
3
|
100
|
|
|
|
9
|
if(@_){ $self->[ _type ] = shift; return $self; } |
|
1
|
|
|
|
|
28
|
|
|
1
|
|
|
|
|
4
|
|
80
|
2
|
100
|
|
|
|
61
|
return $self->[ _type ] if $self->[ _type ]; |
81
|
1
|
|
|
|
|
5
|
$self->[ _type ] = $self->data_obtainer->get_account_type( $self->number ); |
82
|
1
|
|
|
|
|
25
|
return $self->[ _type ]; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub current_balance { |
86
|
3
|
|
|
3
|
1
|
4
|
my $self = shift; |
87
|
3
|
50
|
|
|
|
8
|
if(@_){ $self->[ _current_balance ] = shift; return $self; } |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
88
|
3
|
100
|
|
|
|
93
|
return $self->[ _current_balance ] if $self->[ _current_balance ]; |
89
|
1
|
|
|
|
|
5
|
$self->[ _current_balance ] = $self->data_obtainer->get_credit_account_current_balance( $self->number ); |
90
|
1
|
|
|
|
|
76
|
return $self->[ _current_balance ]; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub available_credit { |
95
|
1
|
|
|
1
|
0
|
3
|
my $self = shift; |
96
|
1
|
50
|
|
|
|
5
|
if(@_){ $self->[ _available_credit ] = shift; return $self; } |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
97
|
1
|
50
|
|
|
|
35
|
return $self->[ _available_credit ] if $self->[ _available_credit ]; |
98
|
1
|
|
|
|
|
7
|
$self->[ _available_credit ] = $self->data_obtainer->get_credit_account_available_credit( $self->number ); |
99
|
1
|
|
|
|
|
27
|
return $self->[ _available_credit ]; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
0
|
|
|
0
|
|
|
sub DESTROY {} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
__END__ |