Packages

A simple Elixir client for BrasilAPI, a public API that provides access to various Brazilian data such as postal codes, banks, states, cities, and more.

Current section

Files

Jump to
brasilapi lib brasilapi exchange.ex
Raw

lib/brasilapi/exchange.ex

defmodule Brasilapi.Exchange do
@moduledoc """
Exchange Rate module for BrasilAPI.
This module provides the main interface for currency exchange rate
functionality, allowing users to get available currencies and
exchange rates between Real and other currencies.
"""
alias Brasilapi.Exchange.API
@doc """
Gets all available currencies for exchange rate queries.
Delegates to `Brasilapi.Exchange.API.get_exchange_currencies/0`.
"""
defdelegate get_exchange_currencies(), to: API
@doc """
Gets the exchange rate between Real and another currency for a specific date.
Delegates to `Brasilapi.Exchange.API.get_exchange_rate/2`.
"""
defdelegate get_exchange_rate(currency, date), to: API
end