Initial commit
This commit is contained in:
18
app/api/v2/coin_market_cap/summary.rb
Normal file
18
app/api/v2/coin_market_cap/summary.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module API
|
||||
module V2
|
||||
module CoinMarketCap
|
||||
class Summary < Grape::API
|
||||
desc 'Overview of market data for all tickers and all market pairs on the exchange'
|
||||
get '/summary' do
|
||||
::Rails.cache.fetch(:markets_summary_cmc, expires_in: 60) do
|
||||
::Market.enabled.ordered.map do |market|
|
||||
format_summary(TickersService[market].ticker, market)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user