Class: Bitfinex::Models::LedgerEntry

Inherits:
Model
  • Object
show all
Defined in:
lib/models/ledger_entry.rb

Constant Summary collapse

BOOL_FIELDS =
[]
FIELDS =
{
  :id => 0,
  :currency => 1,
  :mts => 3,
  :amount => 5,
  :balance => 6,
  :description => 8,
  :wallet => nil
}

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#apply, #serialize

Constructor Details

#initialize(data) ⇒ LedgerEntry

Returns a new instance of LedgerEntry.



21
22
23
24
25
26
# File 'lib/models/ledger_entry.rb', line 21

def initialize (data)
  super(data, FIELDS, BOOL_FIELDS)

  spl = self.description.split('wallet')
  self.wallet = (spl && spl[1]) ? spl[1].trim() : nil
end

Class Method Details

.unserialize(data) ⇒ Object



28
29
30
# File 'lib/models/ledger_entry.rb', line 28

def self.unserialize (data)
  return Model.unserialize(data, FIELDS, BOOL_FIELDS)
end