iban-ex/lib/iban_ex/serialize.ex

10 lines
243 B
Elixir

defmodule IbanEx.Serialize do
alias IbanEx.{Iban, Formatter}
@spec to_string(Iban.t()) :: String.t()
def to_string(iban), do: Formatter.format(iban)
@spec to_map(Iban.t()) :: Map.t()
def to_map(iban), do: Map.from_struct(iban)
end