Packages

Money functions for operations on and localization of a money data type with support for ISO 4217 currencies and ISO 24165 digial tokens (crypto currencies).

Retired package: Deprecated

Current section

Files

Jump to
ex_money lib money exchange_rates callback_module.ex
Raw

lib/money/exchange_rates/callback_module.ex

defmodule Money.ExchangeRates.Callback do
@moduledoc """
Default exchange rates retrieval callback module.
When exchange rates are successfully retrieved, the function
`rates_retrieved/2` is called to perform any desired serialization or
proocessing.
"""
@doc """
Defines the behaviour to retrieve exchange rates from an external
data source.
"""
@callback rates_retrieved(%{}, %DateTime{}) :: :ok
@doc """
Callback function invoked when exchange rates are retrieved.
"""
@spec rates_retrieved(%{}, %DateTime{}) :: :ok
def rates_retrieved(_rates, _retrieved_at) do
:ok
end
end