class Cryptoexchange::Exchanges::FiftyEightCoin::Services::Trades
Public Instance Methods
adapt(response, market_pair)
click to toggle source
# File lib/cryptoexchange/exchanges/fifty_eight_coin/services/trades.rb, line 16 def adapt(response, market_pair) response['result'].collect do |trade| tr = Cryptoexchange::Models::Trade.new tr.base = market_pair.base tr.target = market_pair.target tr.trade_id = nil tr.type = trade[3] tr.price = trade[1] tr.amount = trade[2] tr.timestamp = trade[0] tr.payload = trade tr.market = FiftyEightCoin::Market::NAME tr end end
fetch(market_pair)
click to toggle source
Calls superclass method
Cryptoexchange::Services::Market#fetch
# File lib/cryptoexchange/exchanges/fifty_eight_coin/services/trades.rb, line 5 def fetch(market_pair) response = super(trades_url(market_pair)) adapt(response, market_pair) end
trades_url(market_pair)
click to toggle source
# File lib/cryptoexchange/exchanges/fifty_eight_coin/services/trades.rb, line 10 def trades_url(market_pair) base = market_pair.base.downcase target = market_pair.target.downcase "#{Cryptoexchange::Exchanges::FiftyEightCoin::Market::API_URL}/spot/trades?symbol=#{base}_#{target}" end