class Bitex::Ask

An Ask is an order to sell a given order book. @see BaseOrder

Attributes

produced_amount[RW]

@!attribute produced_amount

@return [BigDecimal] Amount of USD produced from this sale
quantity[RW]

@!attribute quantity TODO: rever esta documentacion

@return [BigDecimal] Quantity of specie to sell in this Ask.
remaining_quantity[RW]

@!attribute remaining_quantity TODO: rever esta documentacion

@return [BigDecimal] Quantity of specie left to sell in this Ask.

Public Class Methods

base_path() click to toggle source

@visibility private

# File lib/bitex/ask.rb, line 50
def self.base_path
  '/asks'
end
create!(order_book, quantity, price, wait = false) click to toggle source

TODO: rever esta documentacion Create a new Ask for selling a Quantity of specie charging no less than Price per each. @param order_book [Symbol] :btc_usd or :btc_ars, whatever you're selling. @param quantity [BigDecimal] Quantity to sell. @param price [BigDecimal] Minimum price to charge when selling. @param wait [Boolean] Block the process and wait until this ask moves out of the :received state, defaults to false. @see bitex.la/developers#create-ask

Calls superclass method
# File lib/bitex/ask.rb, line 61
def self.create!(order_book, quantity, price, wait = false)
  super
end
from_json(json, order = nil) click to toggle source

@visibility private

Calls superclass method
# File lib/bitex/ask.rb, line 66
def self.from_json(json, order = nil)
  super(json, order).tap do |thing|
    thing.quantity = (json[4].presence || 0).to_d
    thing.remaining_quantity = (json[5].presence || 0).to_d
    thing.produced_amount = (json[9].presence || 0).to_d
  end
end