Class: SaltParser::Ofx::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/ofx/account.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from SaltParser::Base

Instance Attribute Details

#available_balanceObject

Returns the value of attribute available_balance.



4
5
6
# File 'lib/ofx/account.rb', line 4

def available_balance
  @available_balance
end

#balanceObject

Returns the value of attribute balance.



4
5
6
# File 'lib/ofx/account.rb', line 4

def balance
  @balance
end

#bank_idObject

Returns the value of attribute bank_id.



4
5
6
# File 'lib/ofx/account.rb', line 4

def bank_id
  @bank_id
end

#broker_idObject

Returns the value of attribute broker_id.



4
5
6
# File 'lib/ofx/account.rb', line 4

def broker_id
  @broker_id
end

#currencyObject

Returns the value of attribute currency.



4
5
6
# File 'lib/ofx/account.rb', line 4

def currency
  @currency
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/ofx/account.rb', line 4

def id
  @id
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/ofx/account.rb', line 4

def name
  @name
end

#transactionsObject

Returns the value of attribute transactions.



4
5
6
# File 'lib/ofx/account.rb', line 4

def transactions
  @transactions
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/ofx/account.rb', line 4

def type
  @type
end

#unit_priceObject

Returns the value of attribute unit_price.



4
5
6
# File 'lib/ofx/account.rb', line 4

def unit_price
  @unit_price
end

#unitsObject

Returns the value of attribute units.



4
5
6
# File 'lib/ofx/account.rb', line 4

def units
  @units
end

Instance Method Details

#identifierObject



7
8
9
# File 'lib/ofx/account.rb', line 7

def identifier
  id
end

#to_hashObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ofx/account.rb', line 11

def to_hash
  {
    :balance           => balance ? balance.to_hash : nil,
    :bank_id           => bank_id,
    :broker_id         => broker_id,
    :currency          => currency,
    :id                => id,
    :name              => name,
    :transactions      => transactions.map(&:to_hash),
    :type              => type,
    :units             => units,
    :unit_price        => unit_price,
    :available_balance => available_balance ? available_balance.to_hash : nil
  }
end