OFX/Institution.pm

filter: Statementstmt 28.2% 11 / 39 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 33.3% 3 / 9 Podpod 100% 6 / 6 totaltotal 28.1% 20 / 71 CC 9 SCAR 21.3
CC
9
Cov
20%
new
20.0
date
6.0
fid
6.0
CRAP 8.4
« OFX.pm ↑ Summary OFX/UserAgent.pm »
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
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $this || $this
ref $this $this
Truth table0%0/3
A || B
A= ref $thisB= $this
ABresult
1X1
011
000
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
BranchTrueFalseTotal
unless defined $self->{$_} 0 0 0
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
BranchTrueFalseTotal
if scalar @_ 0 0 0
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
BranchTrueFalseTotal
if scalar @_ 0 0 0
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
BranchTrueFalseTotal
if scalar @_ 0 0 0
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
BranchTrueFalseTotal
if scalar @_ 0 0 0
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
BranchTrueFalseTotal
if scalar @_ 0 0 0
80 0 $s->{URL}; # Return the stored value
81 }
82  
83 2 1;
84  
85 __END__
« OFX.pm ↑ Summary OFX/UserAgent.pm »