Class: MtGox::Order

Inherits:
Offer
  • Object
show all
Defined in:
lib/mtgox/order.rb

Direct Known Subclasses

Buy, Sell, Trade

Instance Attribute Summary collapse

Attributes inherited from Offer

#amount, #price, #timestamp

Instance Method Summary collapse

Constructor Details

#initialize(order = {}) ⇒ Order

Returns a new instance of Order.



7
8
9
10
11
12
# File 'lib/mtgox/order.rb', line 7

def initialize(order={})
  self.id     = order['oid']
  self.date   = Time.at(order['date'].to_i)
  self.amount = order['amount']['value'].to_f
  self.price  = order['price']['value'].to_f
end

Instance Attribute Details

#dateObject

Returns the value of attribute date.



5
6
7
# File 'lib/mtgox/order.rb', line 5

def date
  @date
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/mtgox/order.rb', line 5

def id
  @id
end