Class: MtGox::Trade

Inherits:
Order show all
Defined in:
lib/mtgox/trade.rb

Instance Attribute Summary

Attributes inherited from Order

#currency, #date, #id, #item, #status

Attributes inherited from Offer

#amount, #client, #price, #timestamp

Instance Method Summary collapse

Constructor Details

#initialize(trade = {}) ⇒ Trade

Returns a new instance of Trade.



6
7
8
9
10
11
# File 'lib/mtgox/trade.rb', line 6

def initialize(trade={})
  self.id     = trade['tid'].to_i
  self.date   = Time.at(trade['date'].to_i)
  self.amount = BigDecimal(trade['amount'])
  self.price  = BigDecimal(trade['price'])
end