Class: CurrencyConversion::ExchangeRatesEndpoint
- Defined in:
- lib/currency-conversion/endpoints/exchange_rates.rb
Overview
Latest Exchange Rates Endpoint
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#latest(base_currency: 'USD', currencies: nil) ⇒ ExchangeRates
Returns the latest exchange rates.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from CurrencyConversion::Resource
Instance Method Details
#latest(base_currency: 'USD', currencies: nil) ⇒ ExchangeRates
Returns the latest exchange rates
15 16 17 18 19 |
# File 'lib/currency-conversion/endpoints/exchange_rates.rb', line 15 def latest(base_currency: 'USD', currencies: nil) params = { base_currency: base_currency } params[:currencies] = currencies.join(',') if currencies.present? ExchangeRates.new get_request('latest', params: params) end |