class Cryptoexchange::Exchanges::C2cx::Services::Pairs

Constants

PAIRS_URL

Public Instance Methods

adapt(response) click to toggle source
# File lib/cryptoexchange/exchanges/c2cx/services/pairs.rb, line 13
def adapt(response)
  market_pairs = []
  response['data']['SupportPairs'].each do |pair|
    target, base = pair.split('_')
    market_pairs << Cryptoexchange::Models::MarketPair.new(
      base: base,
      target: target,
      market: C2cx::Market::NAME
    )
  end
  market_pairs
end
fetch() click to toggle source
Calls superclass method Cryptoexchange::Services::Pairs#fetch
# File lib/cryptoexchange/exchanges/c2cx/services/pairs.rb, line 8
def fetch
  response = super
  adapt(response)
end