Class: OFX::Data::Serialization::Banking::BankAccount

Inherits:
Object
  • Object
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_argsObject



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(, builder)
  builder.BANKID .bank_id
  if .branch_id != ""
    builder.BRANCHID .branch_id
  end
  builder.ACCTID .
  builder.ACCTTYPE acct_type(.)
  if . != ""
    builder.ACCTKEY .
  end
end