Class: MtGox::Ask

Inherits:
Offer
  • Object
show all
Includes:
Value
Defined in:
lib/mtgox/ask.rb

Direct Known Subclasses

MinAsk

Constant Summary

Constants included from Value

Value::INT_MULTIPLIERS

Instance Attribute Summary

Attributes inherited from Offer

#amount, #client, #price, #timestamp

Instance Method Summary collapse

Methods included from Value

#decimalify, #intify, #value_bitcoin, #value_currency

Constructor Details

#initialize(client, hash = nil) ⇒ Ask

Returns a new instance of Ask.



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

def initialize(client, hash = nil)
  self.client = client
  if hash
    self.price = value_currency hash, 'price_int'
    self.amount = value_bitcoin hash, 'amount_int'
    self.timestamp = hash['stamp']
  end
end

Instance Method Details

#epriceObject



17
18
19
# File 'lib/mtgox/ask.rb', line 17

def eprice
  price / (1 - self.client.commission)
end