No, the Concurrency Gem doesn't implement the APIs historical data. It only sets q
and not date
/endDate
as described in the Currency Converter API.
concurrency.rb
:
url = "https://free.currencyconverterapi.com/api/v6/convert?q=#{from}_#{to}&compact=ultra&apiKey=#{Concurrency.configuration.api_key}"
You could use Money Historical Bank instead. Here you can use a Timestamp:
require 'money/bank/historical_bank'
mh = Money::Bank::HistoricalBank.new
# Exchanges 1000 EUR to USD using Date.today (default if no date has been entered).
# Will download today's rates if none have been entered
mh.exchange_with(1000.to_money('EUR'), 'USD')
# Exchanges 1000 EUR to USD using historical rates
date = Date.new(2009,9,9)
mh.set_rate(date, 'USD', 'EUR', 0.7634)
mh.exchange_with(date, 1000.to_money('USD'), 'EUR') # => 763.4 EUR
Money.default_bank = mh