class Market::Exchange::Order
Attributes
commodity[R]
commodity_amount[R]
currency[R]
currency_amount[R]
price[R]
type[R]
Public Class Methods
new(order_data)
click to toggle source
# File lib/exchange/order.rb, line 5 def initialize(order_data) begin @currency = order_data['currency'] @commodity = order_data['commodity'] @type = order_data['type'] @price = BigDecimal.new(order_data['price']) @commodity_amount = BigDecimal.new(order_data['commodity_amount']) @currency_amount = BigDecimal.new(order_data['currency_amount']) rescue puts "Error in Excoin::Market::Exchange::Order.initialize" puts order_data end end
Public Instance Methods
exchange()
click to toggle source
# File lib/exchange/order.rb, line 19 def exchange return Excoin.market.exchange(@currency + @commodity) end