class Cryptoexchange::Exchanges::Coinbene::Services::Pairs

Constants

PAIRS_URL

Public Instance Methods

adapt(output) click to toggle source
# File lib/cryptoexchange/exchanges/coinbene/services/pairs.rb, line 12
def adapt(output)
  pairs = output['ticker'].map do |pair|
    separator = /(USDT|BTC|ETH|BITCNY)\z/ =~ pair['symbol']

    next if separator.nil?

    base   = pair['symbol'][0..separator - 1]
    target = pair['symbol'][separator..-1]
    Cryptoexchange::Models::MarketPair.new(
      base: base,
      target: target,
      market: Coinbene::Market::NAME
    )
  end.compact
end
fetch() click to toggle source
Calls superclass method Cryptoexchange::Services::Pairs#fetch
# File lib/cryptoexchange/exchanges/coinbene/services/pairs.rb, line 7
def fetch
  output = super
  adapt(output)
end