Money.ExchangeRates.historic_rates

You're seeing just the function historic_rates, go back to Money.ExchangeRates module for more information.

Specs

historic_rates(Date.t()) :: {:ok, map()} | {:error, {Exception.t(), binary()}}

Return historic exchange rates.

  • date is a date returned by Date.new/3 or any struct with the elements :year, :month and :day.

Returns:

  • {:ok, rates} if exchange rates are successfully retrieved. rates is a map of exchange rates.

  • {:error, reason} if no exchange rates can be returned.

Note; all dates are expected to be in the Calendar.ISO calendar

This function looks up the historic exchange rates in a an ETS table called :exchange_rates. The actual retrieval of rates is requested through Money.ExchangeRates.Retriever.historic_rates/1.