class Bitex::Bid

A Bid is an order to buy a given order book. @see BaseOrder

Attributes

amount[RW]

@!attribute amount

@return [BigDecimal] Amount of USD to spend in this Bid.
produced_quantity[RW]

@!attribute produced_quantity

TODO: rever esta documentacion
@return [BigDecimal] Quantity of specie produced by this bid so far.
remaining_amount[RW]

@!attribute remaining_amount

@return [BigDecimal] Amount of USD left to be spent in this Bid.

Public Class Methods

base_path() click to toggle source

@visibility private

# File lib/bitex/bid.rb, line 49
def self.base_path
  '/bids'
end
create!(order_book, amount, price, wait = false) click to toggle source

Create a new Bid for spending Amount USD paying no more than price per unit. @param order_book [Symbol] :btc_usd or :btc_ars, whatever you're buying. @param amount [BigDecimal] Amount to spend buying. @param price [BigDecimal] Maximum price to pay per unit. @param wait [Boolean] Block the process and wait until this bid moves out of the :received state, defaults to false. @see bitex.la/developers#create-bid

Calls superclass method Bitex::BaseOrder::create!
# File lib/bitex/bid.rb, line 59
def self.create!(order_book, amount, price, wait = false)
  super
end
from_json(json, order = nil) click to toggle source

@visibility private

Calls superclass method Bitex::BaseOrder::from_json
# File lib/bitex/bid.rb, line 64
def self.from_json(json, order = nil)
  super(json, order).tap do |thing|
    thing.amount = (json[4].presence || 0).to_d
    thing.remaining_amount = (json[5].presence || 0).to_d
    thing.produced_quantity = (json[9].presence || 0).to_d
  end
end