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, #client, #price, #timestamp

Instance Method Summary collapse

Constructor Details

#initialize(order = {}) ⇒ Order

Returns a new instance of Order.



8
9
10
11
12
13
14
15
16
# File 'lib/mtgox/order.rb', line 8

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

Instance Attribute Details

#currencyObject

Returns the value of attribute currency.



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

def currency
  @currency
end

#dateObject

Returns the value of attribute date.



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

def date
  @date
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#itemObject

Returns the value of attribute item.



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

def item
  @item
end

#statusObject

Returns the value of attribute status.



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

def status
  @status
end