Class: OFX::Data::Banking::BankAccount
- Inherits:
-
Object
- Object
- OFX::Data::Banking::BankAccount
- Defined in:
- lib/ofx/data/banking/bank_account.rb
Constant Summary collapse
- VALID_TYPES =
[:checking, :savings, :money_market, :credit_line]
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#account_key ⇒ Object
readonly
Returns the value of attribute account_key.
-
#account_type ⇒ Object
readonly
Returns the value of attribute account_type.
-
#bank_id ⇒ Object
readonly
Returns the value of attribute bank_id.
-
#branch_id ⇒ Object
readonly
Returns the value of attribute branch_id.
Instance Method Summary collapse
- #fitid_str ⇒ Object
-
#initialize(opts) ⇒ BankAccount
constructor
A new instance of BankAccount.
- #ofx_type ⇒ Object
Constructor Details
#initialize(opts) ⇒ BankAccount
Returns a new instance of BankAccount.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ofx/data/banking/bank_account.rb', line 8 def initialize(opts) @bank_id = opts.fetch(:bank_id) raise ArgumentError, ":bank_id must be 1-9 characters long" if @bank_id.length > 9 @branch_id = opts.fetch(:branch_id, "") raise ArgumentError, ":branch_id must be 1-22 characters long" if @branch_id.length > 22 @account_id = opts.fetch(:account_id) raise ArgumentError, ":account_id must be 1-22 characters long" if @account_id.length > 22 @account_type = opts.fetch(:account_type) raise ArgumentError, ":account_type must be one of #{VALID_TYPES.inspect}, it was #{@account_type.inspect}" if !VALID_TYPES.include?(@account_type) @account_key = opts.fetch(:account_key, "") raise ArgumentError, ":account_key must be 1-22 characters long" if @account_key.length > 22 end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
6 7 8 |
# File 'lib/ofx/data/banking/bank_account.rb', line 6 def account_id @account_id end |
#account_key ⇒ Object (readonly)
Returns the value of attribute account_key.
6 7 8 |
# File 'lib/ofx/data/banking/bank_account.rb', line 6 def account_key @account_key end |
#account_type ⇒ Object (readonly)
Returns the value of attribute account_type.
6 7 8 |
# File 'lib/ofx/data/banking/bank_account.rb', line 6 def account_type @account_type end |
#bank_id ⇒ Object (readonly)
Returns the value of attribute bank_id.
6 7 8 |
# File 'lib/ofx/data/banking/bank_account.rb', line 6 def bank_id @bank_id end |
#branch_id ⇒ Object (readonly)
Returns the value of attribute branch_id.
6 7 8 |
# File 'lib/ofx/data/banking/bank_account.rb', line 6 def branch_id @branch_id end |
Instance Method Details
#fitid_str ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/ofx/data/banking/bank_account.rb', line 21 def fitid_str [ :bank_id, :branch_id, :account_id, :account_type, :account_key ].map { |meth| send(meth) }.join("") end |
#ofx_type ⇒ Object
29 30 31 |
# File 'lib/ofx/data/banking/bank_account.rb', line 29 def ofx_type :"banking.bank_account" end |