Class: Eyeofsatoshi::Coinpaprika
- Inherits:
-
Base
- Object
- Base
- Eyeofsatoshi::Coinpaprika
show all
- Defined in:
- lib/coinpaprika.rb
Instance Attribute Summary
Attributes inherited from Base
#options
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#parsed_response(response) ⇒ Object
7
8
9
|
# File 'lib/coinpaprika.rb', line 7
def parsed_response(response)
response.first.dig('close').to_f
end
|
#request ⇒ Object
3
4
5
|
# File 'lib/coinpaprika.rb', line 3
def request
super(:get, url)
end
|
#url ⇒ Object
11
12
13
14
|
# File 'lib/coinpaprika.rb', line 11
def url
pair = @options.fetch(:pair, 'usd')
"https://api.coinpaprika.com/v1/coins/#{options[:symbol]}-#{options[:name]}/ohlcv/today"
end
|