class Cryptoexchange::Exchanges::RadarRelay::Services::Pairs
Constants
- PAIRS_URL
Public Instance Methods
adapt(output)
click to toggle source
# File lib/cryptoexchange/exchanges/radar_relay/services/pairs.rb, line 19 def adapt(output) output.map do |ticker| base, target = ticker['displayName'].split('/') Cryptoexchange::Models::MarketPair.new({ base: base, target: target, market: RadarRelay::Market::NAME }) end end
fetch()
click to toggle source
# File lib/cryptoexchange/exchanges/radar_relay/services/pairs.rb, line 7 def fetch outputs = [] (1..25).each do |page_id| pair_url = PAIRS_URL + "?page=#{page_id}&perPage=100" puts pair_url output = fetch_via_api(pair_url) break if output.empty? outputs = outputs + output end adapt(outputs) end