Class: OFX::BankingAccount

Inherits:
Object
  • Object
show all
Defined in:
lib/ofx/banking_message_set.rb,
lib/ofx/1.0.2/banking_message_set.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#account_identifierObject

Returns the value of attribute account_identifier.



93
94
95
# File 'lib/ofx/banking_message_set.rb', line 93

def 
  @account_identifier
end

#account_keyObject

Returns the value of attribute account_key.



95
96
97
# File 'lib/ofx/banking_message_set.rb', line 95

def 
  @account_key
end

#account_typeObject

Returns the value of attribute account_type.



94
95
96
# File 'lib/ofx/banking_message_set.rb', line 94

def 
  @account_type
end

#bank_identifierObject

Returns the value of attribute bank_identifier.



91
92
93
# File 'lib/ofx/banking_message_set.rb', line 91

def bank_identifier
  @bank_identifier
end

#branch_identifierObject

Returns the value of attribute branch_identifier.



92
93
94
# File 'lib/ofx/banking_message_set.rb', line 92

def branch_identifier
  @branch_identifier
end

Class Method Details

.account_type_to_ofx_102_s(account_type) ⇒ Object



129
130
131
132
133
134
135
136
137
# File 'lib/ofx/1.0.2/banking_message_set.rb', line 129

def self.()
    case 
        when :checking then 'CHECKING'
        when :savings then 'SAVINGS'
        when :money_market then 'MONEYMRKT'
        when :line_of_credit then 'CREDITLINE'
        else raise NotImplementedError
    end
end

.from_ofx_102_hash(account_hash) ⇒ Object



139
140
141
142
143
144
145
146
147
148
149
# File 'lib/ofx/1.0.2/banking_message_set.rb', line 139

def self.from_ofx_102_hash()
     = OFX::BankingAccount.new
    
    .bank_identifier = ['BANKID']
    .branch_identifier = ['BRANCHID']
    . = ['ACCTID']
    . = BankingAccount.(['ACCTTYPE'])
    . = ['ACCTKEY']
    
    
end

.ofx_102_s_to_account_type(account_type) ⇒ Object



120
121
122
123
124
125
126
127
128
# File 'lib/ofx/1.0.2/banking_message_set.rb', line 120

def self.()
    case 
        when 'CHECKING' then :checking
        when 'SAVINGS' then :savings
        when 'MONEYMRKT' then :money_market
        when 'CREDITLINE' then :line_of_credit
        else raise NotImplementedError
    end
end

Instance Method Details

#to_ofx_102_request_bodyObject



108
109
110
111
112
113
114
115
116
117
118
# File 'lib/ofx/1.0.2/banking_message_set.rb', line 108

def to_ofx_102_request_body
    body = []
    body << "        <BANKACCTFROM>"
    body << "          <BANKID>#{bank_identifier}"
    body << "          <BRANCHID>#{branch_identifier}" if branch_identifier
    body << "          <ACCTID>#{}"
    body << "          <ACCTTYPE>#{BankingAccount.()}"
    body << "          <ACCTKEY>#{}" if 
    body << "        </BANKACCTFROM>\n"
    body.join("\n")
end