class Bitstamper::Models::TradingPair
Constants
- MAPPING
Attributes
base_decimals[RW]
counter_decimals[RW]
description[RW]
minimum_order[RW]
name[RW]
trading[RW]
url_symbol[RW]
Public Class Methods
new(hash)
click to toggle source
# File lib/bitstamper/models/trading_pair.rb, line 17 def initialize(hash) hash.each do |key, value| type = ::Bitstamper::Models::TradingPair::MAPPING.fetch(key, nil) value = value && type ? ::Bitstamper::Utilities::convert_value(value, type) : value self.send("#{key}=", value) if self.respond_to?(key) end end
parse(data)
click to toggle source
# File lib/bitstamper/models/trading_pair.rb, line 29 def self.parse(data) data&.collect { |item| ::Bitstamper::Models::TradingPair.new(item) } end
Public Instance Methods
enabled?()
click to toggle source
# File lib/bitstamper/models/trading_pair.rb, line 25 def enabled? self.trading.downcase.strip.eql?("enabled") end