class Cryptoexchange::Exchanges::Bcex::Services::Pairs

Constants

HTTP_METHOD
PAIRS_URL

Public Instance Methods

adapt(output) click to toggle source
# File lib/cryptoexchange/exchanges/bcex/services/pairs.rb, line 13
def adapt(output)
  pairs_list = []
  output.map do |target, base_info|
    base_info.map do |info|
      base = info['coin_from']
      pairs_list << [base, target]
    end
  end
  pairs_list.map do |pair|
    base, target = pair
    Cryptoexchange::Models::MarketPair.new(
      base:   base,
      target: target,
      market: Bcex::Market::NAME
    )
  end
end
fetch() click to toggle source
Calls superclass method Cryptoexchange::Services::Pairs#fetch
# File lib/cryptoexchange/exchanges/bcex/services/pairs.rb, line 8
def fetch
  output = super
  adapt(output)
end