Class: OFX::Data::Serialization::Banking::BankAccount
- Inherits:
-
Object
- Object
- OFX::Data::Serialization::Banking::BankAccount
show all
- Includes:
- Common
- Defined in:
- lib/ofx/data/serialization/banking/bank_account.rb
Constant Summary
collapse
- ACCT_TYPES =
{
checking: "CHECKING".freeze,
savings: "SAVINGS".freeze,
money_market: "MONEYMRKT".freeze,
credit_line: "CREDITLINE"
}
Instance Method Summary
collapse
Methods included from Common
included, #initialize, #registry_entry, #serialize_collection, #serialize_object
Instance Method Details
#acct_type(type) ⇒ Object
33
34
35
|
# File 'lib/ofx/data/serialization/banking/bank_account.rb', line 33
def acct_type(type)
ACCT_TYPES.fetch(type)
end
|
#default_registry_entry_args ⇒ Object
17
18
19
|
# File 'lib/ofx/data/serialization/banking/bank_account.rb', line 17
def default_registry_entry_args
[:"banking.bank_account", nil]
end
|
#serialize(bank_account, builder) ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/ofx/data/serialization/banking/bank_account.rb', line 21
def serialize(bank_account, builder)
builder.BANKID bank_account.bank_id
if bank_account.branch_id != ""
builder.BRANCHID bank_account.branch_id
end
builder.ACCTID bank_account.account_id
builder.ACCTTYPE acct_type(bank_account.account_type)
if bank_account.account_key != ""
builder.ACCTKEY bank_account.account_key
end
end
|