Class: Cryptoexchange::Exchanges::Crxzone::Services::IdFetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/cryptoexchange/exchanges/crxzone/services/id_fetcher.rb

Class Method Summary collapse

Class Method Details

.get_id(base, target) ⇒ Object



5
6
7
8
9
# File 'lib/cryptoexchange/exchanges/crxzone/services/id_fetcher.rb', line 5

def self.get_id(base, target)
  pairs_response = HTTP.get(Cryptoexchange::Exchanges::Crxzone::Services::Pairs::PAIRS_URL)
  pairs_result = pairs_response.parse(:json)['Result']
  pairs_result.select { |s| s['PrimaryCurrencyCode'] == base && s['SecondaryCurrencyName'] == target }
end