Module: CoinMarketCap::Endpoints::Cryptocurrency

Included in:
Api::Client
Defined in:
lib/coinmarketcap/endpoints/cryptocurrency.rb

Instance Method Summary collapse

Instance Method Details

#info(options = {}) ⇒ Object



9
10
11
12
13
14
# File 'lib/coinmarketcap/endpoints/cryptocurrency.rb', line 9

def info(options = {})
  response = get('cryptocurrency/info', options)
  response['data'].map do |key, value|
    [key, CoinMarketCap::Resources::Metadata.new(value)]
  end.to_h
end

#listings_latest(options = {}) ⇒ Object



16
17
18
19
# File 'lib/coinmarketcap/endpoints/cryptocurrency.rb', line 16

def listings_latest(options = {})
  response = get('cryptocurrency/listings/latest', options)
  response['data'].map { |row| CoinMarketCap::Resources::Listing.new(row) }
end

#map(options = {}) ⇒ Object



4
5
6
7
# File 'lib/coinmarketcap/endpoints/cryptocurrency.rb', line 4

def map(options = {})
  response = get('cryptocurrency/map', options)
  response['data'].map { |row| CoinMarketCap::Resources::Cryptocurrency.new(row) }
end

#quotes_latest(options = {}) ⇒ Object



21
22
23
24
25
26
# File 'lib/coinmarketcap/endpoints/cryptocurrency.rb', line 21

def quotes_latest(options = {})
  response = get('cryptocurrency/quotes/latest', options)
  response['data'].map do |key, value|
    [key, CoinMarketCap::Resources::Listing.new(value)]
  end.to_h
end