# `Money.ExchangeRates.Cache`
[🔗](https://github.com/kipcole9/money/blob/v6.0.0-rc.0/lib/money/exchange_rates/exchange_rates_cache.ex#L1)

Defines a cache behaviour and default inplementation
of a cache for exchange rates

# `historic_rates`

```elixir
@callback historic_rates(Date.t()) :: {:ok, map()} | {:error, {Exception.t(), String.t()}}
```

Returns the exchange rates for a given
date.

# `init`

```elixir
@callback init() :: any()
```

Initialize the cache when the exchange rates
retriever is started

# `latest_rates`

```elixir
@callback latest_rates() :: {:ok, map()} | {:error, {Exception.t(), String.t()}}
```

Retrieve the latest exchange rates from the
cache.

# `store_historic_rates`

```elixir
@callback store_historic_rates(map(), Date.t()) :: :ok
```

Store the historic exchange rates for a given
date in the cache.

# `store_latest_rates`

```elixir
@callback store_latest_rates(map(), DateTime.t()) :: :ok
```

Store the latest exchange rates in the cache.

# `terminate`

```elixir
@callback terminate() :: any()
```

Terminate the cache when the retriver process
stops normally

# `cache`

# `historic_rates`

# `latest_rates`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
