| 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 <bfoz@bfoz.net> | ||||||||||||||||||||
| 7 | # | ||||||||||||||||||||
| 8 | # Copyright 2008 Brandon Fosdick <bfoz@bfoz.net> (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 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 15 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 2 | our $VERSION = '2'; | |||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 2 | ▶ | use constant DEFAULT_OPTIONS => | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 20 | { | ||||||||||||||||||||
| 21 | 'language' => 'ENG', | ||||||||||||||||||||
| 22 | 'Date' => 28800, # 1970-01-01 | ||||||||||||||||||||
| 23 | 2 | }; | |||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | sub new | ||||||||||||||||||||
| 26 | 0 | ▶ | { | ||||||||||||||||||
|
Subroutine
new: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||
| 27 | 0 | my ($this, %options) = @_; | |||||||||||||||||||
| 28 | 0 | ▶ | my $class = ref($this) || $this; | ||||||||||||||||||
|
Condition0%0/3
ref $this || $this
MC/DC0%0/2
ref $this || $this
ref $this
$this
Truth table0%0/3
A || B
A= ref $thisB= $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()} ) | |||||||||||||||||||
| 41 | { | ||||||||||||||||||||
| 42 | 0 | ▶ | $self->{$_} = DEFAULT_OPTIONS()->{$_} unless defined $self->{$_}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 43 | } | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 0 | return $self; | |||||||||||||||||||
| 46 | } | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | sub date | ||||||||||||||||||||
| 49 | 0 | ▶ | { | ||||||||||||||||||
|
Subroutine
date: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 50 | 0 | my $s = shift; | |||||||||||||||||||
| 51 | 0 | ▶ | $s->{Date} = shift if scalar @_; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 52 | 0 | $s->{Date}; | |||||||||||||||||||
| 53 | } | ||||||||||||||||||||
| 54 | |||||||||||||||||||||
| 55 | sub fid | ||||||||||||||||||||
| 56 | 0 | ▶ | { | ||||||||||||||||||
|
Subroutine
fid: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 57 | 0 | my $s = shift; | |||||||||||||||||||
| 58 | 0 | ▶ | $s->{FID} = shift if scalar @_; # Assign new value if an argument is given | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 59 | 0 | $s->{FID}; # Return the stored value | |||||||||||||||||||
| 60 | } | ||||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | sub language | ||||||||||||||||||||
| 63 | 0 | ▶ | { | ||||||||||||||||||
|
Subroutine
language: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 64 | 0 | my $s = shift; | |||||||||||||||||||
| 65 | 0 | ▶ | $s->{language} = shift if scalar @_; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 66 | 0 | $s->{language}; | |||||||||||||||||||
| 67 | } | ||||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | sub org | ||||||||||||||||||||
| 70 | 0 | ▶ | { | ||||||||||||||||||
|
Subroutine
org: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 71 | 0 | my $s = shift; | |||||||||||||||||||
| 72 | 0 | ▶ | $s->{ORG} = shift if scalar @_; # Assign new value if an argument is given | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 73 | 0 | $s->{ORG}; # Return the stored value | |||||||||||||||||||
| 74 | } | ||||||||||||||||||||
| 75 | |||||||||||||||||||||
| 76 | sub url | ||||||||||||||||||||
| 77 | 0 | ▶ | { | ||||||||||||||||||
|
Subroutine
url: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 78 | 0 | my $s = shift; | |||||||||||||||||||
| 79 | 0 | ▶ | $s->{URL} = shift if scalar @_; # Assign new value if an argument is given | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 80 | 0 | $s->{URL}; # Return the stored value | |||||||||||||||||||
| 81 | } | ||||||||||||||||||||
| 82 | |||||||||||||||||||||
| 83 | 2 | 1; | |||||||||||||||||||
| 84 | |||||||||||||||||||||
| 85 | __END__ | ||||||||||||||||||||