class Market::Exchange::OrderDepthChart::DataPoint

Attributes

currency_amount[R]
price[R]
type[R]

Public Class Methods

new(order_data) click to toggle source
# File lib/exchange/order_depth_data.rb, line 4
def initialize(order_data)
  update(order_data)
end

Protected Instance Methods

update(order_data) click to toggle source
# File lib/exchange/order_depth_data.rb, line 10
def update(order_data)
  begin
    type_array = order_data.select{|h| h != "price"}.to_a.flatten
    @type = type_array[0]
    @currency_amount = type_array[1]
    @price = BigDecimal.new(order_data['price'])
  rescue
    puts "Error in Excoin::Market::Exchange::OrderDepthChart::DataPoint.update"
    puts order_data
  end
end