class Bitstamper::Models::LiveTrade

Constants

MAPPING
TYPES

Attributes

amount[RW]
amount_str[RW]
buy_order_id[RW]
epoch[RW]
id[RW]
price[RW]
price_str[RW]
product[RW]
sell_order_id[RW]
timestamp[RW]
type[RW]

Public Class Methods

new(hash) click to toggle source
# File lib/bitstamper/models/live_trade.rb, line 29
def initialize(hash)
  hash.each do |key, value|
    type      =     ::Bitstamper::Models::LiveTrade::MAPPING.fetch(key, nil)
    value     =     value && type ? ::Bitstamper::Utilities::convert_value(value, type) : value
    self.send("#{key}=", value) if self.respond_to?(key)
  end
  
  self.type   =   TYPES[self.type]
end