Module: CoinMarketCap::Endpoints::Cryptocurrency
- Included in:
- Api::Client
- Defined in:
- lib/coinmarketcap/endpoints/cryptocurrency.rb
Instance Method Summary collapse
- #info(options = {}) ⇒ Object
- #listings_latest(options = {}) ⇒ Object
- #map(options = {}) ⇒ Object
- #quotes_latest(options = {}) ⇒ Object
Instance Method Details
#info(options = {}) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/coinmarketcap/endpoints/cryptocurrency.rb', line 9 def info( = {}) response = get('cryptocurrency/info', ) 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( = {}) response = get('cryptocurrency/listings/latest', ) 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( = {}) response = get('cryptocurrency/map', ) 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( = {}) response = get('cryptocurrency/quotes/latest', ) response['data'].map do |key, value| [key, CoinMarketCap::Resources::Listing.new(value)] end.to_h end |