line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Filename: Institution.pm |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Class interface for an OFX financial institution |
4
|
|
|
|
|
|
|
# http://www.ofx.net/ |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Created January 30, 2008 Brandon Fosdick |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Copyright 2008 Brandon Fosdick (BSD License) |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# $Id: Institution.pm,v 1.2 2008/03/04 04:22:27 bfoz Exp $ |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Finance::OFX::Institution; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
17603
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
62
|
|
15
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
667
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = '2'; |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
|
|
1188
|
use constant DEFAULT_OPTIONS => |
20
|
|
|
|
|
|
|
{ |
21
|
|
|
|
|
|
|
'language' => 'ENG', |
22
|
|
|
|
|
|
|
'Date' => 28800, # 1970-01-01 |
23
|
1
|
|
|
1
|
|
8
|
}; |
|
1
|
|
|
|
|
2
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub new |
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
0
|
1
|
|
my ($this, %options) = @_; |
28
|
0
|
|
0
|
|
|
|
my $class = ref($this) || $this; |
29
|
0
|
|
|
|
|
|
my $self = {}; |
30
|
0
|
|
|
|
|
|
bless $self, $class; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# Initialization |
33
|
0
|
|
|
|
|
|
$self->{ORG} = delete $options{ORG}; |
34
|
0
|
|
|
|
|
|
$self->{FID} = delete $options{FID}; |
35
|
0
|
|
|
|
|
|
$self->{URL} = delete $options{URL}; |
36
|
0
|
|
|
|
|
|
$self->{Date} = delete $options{Date}; |
37
|
0
|
|
|
|
|
|
$self->{language} = delete $options{language}; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# Defaults |
40
|
0
|
|
|
|
|
|
for( keys %{DEFAULT_OPTIONS()} ) |
|
0
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
{ |
42
|
0
|
0
|
|
|
|
|
$self->{$_} = DEFAULT_OPTIONS()->{$_} unless defined $self->{$_}; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
return $self; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub date |
49
|
|
|
|
|
|
|
{ |
50
|
0
|
|
|
0
|
1
|
|
my $s = shift; |
51
|
0
|
0
|
|
|
|
|
$s->{Date} = shift if scalar @_; |
52
|
0
|
|
|
|
|
|
$s->{Date}; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub fid |
56
|
|
|
|
|
|
|
{ |
57
|
0
|
|
|
0
|
1
|
|
my $s = shift; |
58
|
0
|
0
|
|
|
|
|
$s->{FID} = shift if scalar @_; # Assign new value if an argument is given |
59
|
0
|
|
|
|
|
|
$s->{FID}; # Return the stored value |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub language |
63
|
|
|
|
|
|
|
{ |
64
|
0
|
|
|
0
|
1
|
|
my $s = shift; |
65
|
0
|
0
|
|
|
|
|
$s->{language} = shift if scalar @_; |
66
|
0
|
|
|
|
|
|
$s->{language}; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub org |
70
|
|
|
|
|
|
|
{ |
71
|
0
|
|
|
0
|
1
|
|
my $s = shift; |
72
|
0
|
0
|
|
|
|
|
$s->{ORG} = shift if scalar @_; # Assign new value if an argument is given |
73
|
0
|
|
|
|
|
|
$s->{ORG}; # Return the stored value |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub url |
77
|
|
|
|
|
|
|
{ |
78
|
0
|
|
|
0
|
1
|
|
my $s = shift; |
79
|
0
|
0
|
|
|
|
|
$s->{URL} = shift if scalar @_; # Assign new value if an argument is given |
80
|
0
|
|
|
|
|
|
$s->{URL}; # Return the stored value |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
__END__ |