diff --git a/lib/iban_ex/country/at.ex b/lib/iban_ex/country/at.ex index 00ae2fe..a69b8ba 100644 --- a/lib/iban_ex/country/at.ex +++ b/lib/iban_ex/country/at.ex @@ -3,32 +3,8 @@ defmodule IbanEx.Country.AT do Austria IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 20 - @rule ~r/^(?[0-9]{5})(?[0-9]{11})$/i - @spec size() :: 20 - def size(), do: @size - - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( - %Iban{ - country_code: country_code, - check_digits: check_digits, - bank_code: bank_code, - account_number: account_number - } = _iban, - joiner \\ " " - ) do - [country_code, check_digits, bank_code, account_number] - |> Enum.join(joiner) - end + use IbanEx.Country.Template end diff --git a/lib/iban_ex/country/be.ex b/lib/iban_ex/country/be.ex index 9b6046b..56df70e 100644 --- a/lib/iban_ex/country/be.ex +++ b/lib/iban_ex/country/be.ex @@ -3,23 +3,15 @@ defmodule IbanEx.Country.BE do Belgium IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 16 - @rule ~r/^(?[0-9]{3})(?[0-9]{7})(?[0-9]{2})$/i - @spec size() :: 16 - def size(), do: @size + use IbanEx.Country.Template - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( + @impl IbanEx.Country.Template + @spec to_string(Iban.t()) :: binary() + @spec to_string(Iban.t(), binary()) :: binary() + def to_string( %Iban{ country_code: country_code, check_digits: check_digits, diff --git a/lib/iban_ex/country/bg.ex b/lib/iban_ex/country/bg.ex index 8c6e290..64e5a38 100644 --- a/lib/iban_ex/country/bg.ex +++ b/lib/iban_ex/country/bg.ex @@ -3,23 +3,17 @@ defmodule IbanEx.Country.BG do Bulgaria IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 22 - @rule ~r/^(?[A-Z]{4})(?[0-9]{4})(?[0-9]{2}[0-9A-Z]{8})$/i + use IbanEx.Country.Template + @spec size() :: 22 - def size(), do: @size - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( + @impl IbanEx.Country.Template + @spec to_string(Iban.t()) :: binary() + @spec to_string(Iban.t(), binary()) :: binary() + def to_string( %Iban{ country_code: country_code, check_digits: check_digits, diff --git a/lib/iban_ex/country/ch.ex b/lib/iban_ex/country/ch.ex index 0aa9d96..f2f10e7 100644 --- a/lib/iban_ex/country/ch.ex +++ b/lib/iban_ex/country/ch.ex @@ -3,32 +3,8 @@ defmodule IbanEx.Country.CH do Switzerland IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 21 - @rule ~r/^(?[0-9]{5})(?[0-9A-Z]{12})$/i - @spec size() :: 21 - def size(), do: @size - - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( - %Iban{ - country_code: country_code, - check_digits: check_digits, - bank_code: bank_code, - account_number: account_number - } = _iban, - joiner \\ " " - ) do - [country_code, check_digits, bank_code, account_number] - |> Enum.join(joiner) - end + use IbanEx.Country.Template end diff --git a/lib/iban_ex/country/cy.ex b/lib/iban_ex/country/cy.ex index 015eb56..113a8fa 100644 --- a/lib/iban_ex/country/cy.ex +++ b/lib/iban_ex/country/cy.ex @@ -3,23 +3,15 @@ defmodule IbanEx.Country.CY do Cyprus IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 28 - @rule ~r/^(?[0-9]{3})(?[0-9]{5})(?[0-9A-Z]{16})$/i - @spec size() :: 28 - def size(), do: @size + use IbanEx.Country.Template - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( + @impl IbanEx.Country.Template + @spec to_string(Iban.t()) :: binary() + @spec to_string(Iban.t(), binary()) :: binary() + def to_string( %Iban{ country_code: country_code, check_digits: check_digits, diff --git a/lib/iban_ex/country/cz.ex b/lib/iban_ex/country/cz.ex index 97953b2..2f0c873 100644 --- a/lib/iban_ex/country/cz.ex +++ b/lib/iban_ex/country/cz.ex @@ -3,34 +3,8 @@ defmodule IbanEx.Country.CZ do Czech Republic IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 24 - @rule ~r/^(?[0-9]{4})(?[0-9]{16})$/i - @spec size() :: 24 - def size(), do: @size - - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( - %Iban{ - country_code: country_code, - check_digits: check_digits, - bank_code: bank_code, - branch_code: _branch_code, - national_check: _national_check, - account_number: account_number - } = _iban, - joiner \\ " " - ) do - [country_code, check_digits, bank_code, account_number] - |> Enum.join(joiner) - end + use IbanEx.Country.Template end diff --git a/lib/iban_ex/country/de.ex b/lib/iban_ex/country/de.ex index 3df5418..4ba5d00 100644 --- a/lib/iban_ex/country/de.ex +++ b/lib/iban_ex/country/de.ex @@ -3,34 +3,8 @@ defmodule IbanEx.Country.DE do Germany IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 22 - @rule ~r/^(?[0-9]{8})(?[0-9]{10})$/i - @spec size() :: 22 - def size(), do: @size - - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( - %Iban{ - country_code: country_code, - check_digits: check_digits, - bank_code: bank_code, - branch_code: _branch_code, - national_check: _national_check, - account_number: account_number - } = _iban, - joiner \\ " " - ) do - [country_code, check_digits, bank_code, account_number] - |> Enum.join(joiner) - end + use IbanEx.Country.Template end diff --git a/lib/iban_ex/country/dk.ex b/lib/iban_ex/country/dk.ex index 46ea37a..ad00436 100644 --- a/lib/iban_ex/country/dk.ex +++ b/lib/iban_ex/country/dk.ex @@ -2,35 +2,8 @@ defmodule IbanEx.Country.DK do @moduledoc """ Denmark IBAN parsing rules """ - - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 18 - @rule ~r/^(?[0-9]{4})(?[0-9]{10})$/i - @spec size() :: 18 - def size(), do: @size - - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( - %Iban{ - country_code: country_code, - check_digits: check_digits, - bank_code: bank_code, - branch_code: _branch_code, - national_check: _national_check, - account_number: account_number - } = _iban, - joiner \\ " " - ) do - [country_code, check_digits, bank_code, account_number] - |> Enum.join(joiner) - end + use IbanEx.Country.Template end diff --git a/lib/iban_ex/country/ee.ex b/lib/iban_ex/country/ee.ex index 48e846a..8cde443 100644 --- a/lib/iban_ex/country/ee.ex +++ b/lib/iban_ex/country/ee.ex @@ -3,23 +3,15 @@ defmodule IbanEx.Country.EE do Estonian IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 20 - @rule ~r/^(?[0-9]{2})(?[0-9]{2})(?[0-9]{11})(?[0-9]{1})$/i - @spec size() :: 20 - def size(), do: @size + use IbanEx.Country.Template - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( + @impl IbanEx.Country.Template + @spec to_string(Iban.t()) :: binary() + @spec to_string(Iban.t(), binary()) :: binary() + def to_string( %Iban{ country_code: country_code, check_digits: check_digits, diff --git a/lib/iban_ex/country/es.ex b/lib/iban_ex/country/es.ex index adc3318..4f9a457 100644 --- a/lib/iban_ex/country/es.ex +++ b/lib/iban_ex/country/es.ex @@ -3,23 +3,15 @@ defmodule IbanEx.Country.ES do Spain IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 24 - @rule ~r/^(?[0-9]{4})(?[0-9]{4})(?[0-9]{2})(?[0-9]{10})$/i - @spec size() :: 24 - def size(), do: @size + use IbanEx.Country.Template - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( + @impl IbanEx.Country.Template + @spec to_string(Iban.t()) :: binary() + @spec to_string(Iban.t(), binary()) :: binary() + def to_string( %Iban{ country_code: country_code, check_digits: check_digits, diff --git a/lib/iban_ex/country/fi.ex b/lib/iban_ex/country/fi.ex index 601855b..cafa9b8 100644 --- a/lib/iban_ex/country/fi.ex +++ b/lib/iban_ex/country/fi.ex @@ -3,23 +3,15 @@ defmodule IbanEx.Country.FI do Finland IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 18 - @rule ~r/^(?[0-9]{6})(?[0-9]{7})(?[0-9]{1})$/i - @spec size() :: 18 - def size(), do: @size + use IbanEx.Country.Template - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( + @impl IbanEx.Country.Template + @spec to_string(Iban.t()) :: binary() + @spec to_string(Iban.t(), binary()) :: binary() + def to_string( %Iban{ country_code: country_code, check_digits: check_digits, diff --git a/lib/iban_ex/country/fr.ex b/lib/iban_ex/country/fr.ex index 8908d6f..cc8d11a 100644 --- a/lib/iban_ex/country/fr.ex +++ b/lib/iban_ex/country/fr.ex @@ -3,23 +3,15 @@ defmodule IbanEx.Country.FR do France IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 27 - @rule ~r/^(?[0-9]{5})(?[0-9]{5})(?[0-9A-Z]{11})(?[0-9]{2})$/i - @spec size() :: 27 - def size(), do: @size + use IbanEx.Country.Template - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( + @impl IbanEx.Country.Template + @spec to_string(Iban.t()) :: binary() + @spec to_string(Iban.t(), binary()) :: binary() + def to_string( %Iban{ country_code: country_code, check_digits: check_digits, diff --git a/lib/iban_ex/country/gb.ex b/lib/iban_ex/country/gb.ex index e7099e9..61cb7dd 100644 --- a/lib/iban_ex/country/gb.ex +++ b/lib/iban_ex/country/gb.ex @@ -3,23 +3,15 @@ defmodule IbanEx.Country.GB do United Kingdom IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 22 - @rule ~r/^(?[A-Z]{4})(?[0-9]{6})(?[0-9]{8})$/i - @spec size() :: 22 - def size(), do: @size + use IbanEx.Country.Template - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( + @impl IbanEx.Country.Template + @spec to_string(Iban.t()) :: binary() + @spec to_string(Iban.t(), binary()) :: binary() + def to_string( %Iban{ country_code: country_code, check_digits: check_digits, diff --git a/lib/iban_ex/country/hr.ex b/lib/iban_ex/country/hr.ex index 416a1fa..bc321e1 100644 --- a/lib/iban_ex/country/hr.ex +++ b/lib/iban_ex/country/hr.ex @@ -3,34 +3,8 @@ defmodule IbanEx.Country.HR do Croatia IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 21 - @rule ~r/^(?[0-9]{7})(?[0-9]{10})$/i - @spec size() :: 21 - def size(), do: @size - - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( - %Iban{ - country_code: country_code, - check_digits: check_digits, - bank_code: bank_code, - branch_code: _branch_code, - national_check: _national_check, - account_number: account_number - } = _iban, - joiner \\ " " - ) do - [country_code, check_digits, bank_code, account_number] - |> Enum.join(joiner) - end + use IbanEx.Country.Template end diff --git a/lib/iban_ex/country/lt.ex b/lib/iban_ex/country/lt.ex index bc21e5b..dba384e 100644 --- a/lib/iban_ex/country/lt.ex +++ b/lib/iban_ex/country/lt.ex @@ -3,34 +3,8 @@ defmodule IbanEx.Country.LT do Lithuanian IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 20 - @rule ~r/^(?[0-9]{5})(?[0-9]{11})$/i - @spec size() :: 20 - def size(), do: @size - - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( - %Iban{ - country_code: country_code, - check_digits: check_digits, - bank_code: bank_code, - branch_code: _branch_code, - national_check: _national_check, - account_number: account_number - } = _iban, - joiner \\ " " - ) do - [country_code, check_digits, bank_code, account_number] - |> Enum.join(joiner) - end + use IbanEx.Country.Template end diff --git a/lib/iban_ex/country/lu.ex b/lib/iban_ex/country/lu.ex index f5dd419..3ebc71e 100644 --- a/lib/iban_ex/country/lu.ex +++ b/lib/iban_ex/country/lu.ex @@ -3,34 +3,8 @@ defmodule IbanEx.Country.LU do Luxembourg IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 20 - @rule ~r/^(?[0-9]{3})(?[0-9A-Z]{13})$/i - @spec size() :: 20 - def size(), do: @size - - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( - %Iban{ - country_code: country_code, - check_digits: check_digits, - bank_code: bank_code, - branch_code: _branch_code, - national_check: _national_check, - account_number: account_number - } = _iban, - joiner \\ " " - ) do - [country_code, check_digits, bank_code, account_number] - |> Enum.join(joiner) - end + use IbanEx.Country.Template end diff --git a/lib/iban_ex/country/lv.ex b/lib/iban_ex/country/lv.ex index 64829ee..ca6f5da 100644 --- a/lib/iban_ex/country/lv.ex +++ b/lib/iban_ex/country/lv.ex @@ -3,34 +3,8 @@ defmodule IbanEx.Country.LV do Latvian IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 21 - @rule ~r/^(?[A-Z]{4})(?[0-9A-Z]{13})$/i - @spec size() :: 21 - def size(), do: @size - - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( - %Iban{ - country_code: country_code, - check_digits: check_digits, - bank_code: bank_code, - branch_code: _branch_code, - national_check: _national_check, - account_number: account_number - } = _iban, - joiner \\ " " - ) do - [country_code, check_digits, bank_code, account_number] - |> Enum.join(joiner) - end + use IbanEx.Country.Template end diff --git a/lib/iban_ex/country/mt.ex b/lib/iban_ex/country/mt.ex index 3c944b9..596edfa 100644 --- a/lib/iban_ex/country/mt.ex +++ b/lib/iban_ex/country/mt.ex @@ -3,23 +3,15 @@ defmodule IbanEx.Country.MT do Malta IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 31 - @rule ~r/^(?[A-Z]{4})(?[0-9]{5})(?[0-9A-Z]{18})$/i - @spec size() :: 31 - def size(), do: @size + use IbanEx.Country.Template - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( + @impl IbanEx.Country.Template + @spec to_string(Iban.t()) :: binary() + @spec to_string(Iban.t(), binary()) :: binary() + def to_string( %Iban{ country_code: country_code, check_digits: check_digits, diff --git a/lib/iban_ex/country/nl.ex b/lib/iban_ex/country/nl.ex index d910d30..b76534c 100644 --- a/lib/iban_ex/country/nl.ex +++ b/lib/iban_ex/country/nl.ex @@ -3,34 +3,8 @@ defmodule IbanEx.Country.NL do Netherlands IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 18 - @rule ~r/^(?[A-Z]{4})(?[0-9]{10})$/i - @spec size() :: 18 - def size(), do: @size - - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( - %Iban{ - country_code: country_code, - check_digits: check_digits, - bank_code: bank_code, - branch_code: _branch_code, - national_check: _national_check, - account_number: account_number - } = _iban, - joiner \\ " " - ) do - [country_code, check_digits, bank_code, account_number] - |> Enum.join(joiner) - end + use IbanEx.Country.Template end diff --git a/lib/iban_ex/country/pl.ex b/lib/iban_ex/country/pl.ex index 7c42790..e140bba 100644 --- a/lib/iban_ex/country/pl.ex +++ b/lib/iban_ex/country/pl.ex @@ -3,23 +3,15 @@ defmodule IbanEx.Country.PL do Poland IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 28 - @rule ~r/^(?[0-9]{3})(?[0-9]{4})(?[0-9]{1})(?[0-9]{16})$/i - @spec size() :: 28 - def size(), do: @size + use IbanEx.Country.Template - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( + @impl IbanEx.Country.Template + @spec to_string(Iban.t()) :: binary() + @spec to_string(Iban.t(), binary()) :: binary() + def to_string( %Iban{ country_code: country_code, check_digits: check_digits, diff --git a/lib/iban_ex/country/pt.ex b/lib/iban_ex/country/pt.ex index 6195bb8..5909178 100644 --- a/lib/iban_ex/country/pt.ex +++ b/lib/iban_ex/country/pt.ex @@ -3,23 +3,15 @@ defmodule IbanEx.Country.PT do Portugal IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 25 - @rule ~r/^(?[0-9]{4})(?[0-9]{4})(?[0-9]{11})(?[0-9]{2})$/i - @spec size() :: 25 - def size(), do: @size + use IbanEx.Country.Template - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( + @impl IbanEx.Country.Template + @spec to_string(Iban.t()) :: binary() + @spec to_string(Iban.t(), binary()) :: binary() + def to_string( %Iban{ country_code: country_code, check_digits: check_digits, diff --git a/lib/iban_ex/country/template.ex b/lib/iban_ex/country/template.ex index 7f761a0..a20f182 100644 --- a/lib/iban_ex/country/template.ex +++ b/lib/iban_ex/country/template.ex @@ -1,4 +1,6 @@ defmodule IbanEx.Country.Template do + @moduledoc false + alias IbanEx.Iban @type size() :: non_neg_integer() @type rule() :: Regex.t() @@ -7,6 +9,41 @@ defmodule IbanEx.Country.Template do @callback size() :: size() @callback rule() :: rule() - @callback to_s(Iban.t(), joiner()) :: String.t() - @callback to_s(Iban.t()) :: String.t() + @callback to_string(Iban.t(), joiner()) :: String.t() + @callback to_string(Iban.t()) :: String.t() + + defmacro __using__(_opts) do + quote do + alias IbanEx.Iban + @behaviour IbanEx.Country.Template + + @impl IbanEx.Country.Template + @spec to_string(Iban.t()) :: binary() + @spec to_string(Iban.t(), binary()) :: binary() + def to_string( + %Iban{ + country_code: country_code, + check_digits: check_digits, + bank_code: bank_code, + branch_code: _branch_code, + national_check: _national_check, + account_number: account_number + } = _iban, + joiner \\ " " + ) do + [country_code, check_digits, bank_code, account_number] + |> Enum.join(joiner) + end + + @impl IbanEx.Country.Template + @spec size() :: Integer.t() + def size(), do: @size + + @impl IbanEx.Country.Template + @spec rule() :: Regex.t() + def rule(), do: @rule + + defoverridable to_string: 1, to_string: 2, size: 0, rule: 0 + end + end end diff --git a/lib/iban_ex/country/ua.ex b/lib/iban_ex/country/ua.ex index 0b53d46..f09a508 100644 --- a/lib/iban_ex/country/ua.ex +++ b/lib/iban_ex/country/ua.ex @@ -3,34 +3,8 @@ defmodule IbanEx.Country.UA do Ukrainian IBAN parsing rules """ - alias IbanEx.Iban - - @behaviour IbanEx.Country.Template - @size 29 - @rule ~r/^(?[0-9]{6})(?[0-9A-Z]{19})$/i - @spec size() :: 29 - def size(), do: @size - - @spec rule() :: Regex.t() - def rule(), do: @rule - - @spec to_s(Iban.t()) :: binary() - @spec to_s(Iban.t(), binary()) :: binary() - def to_s( - %Iban{ - country_code: country_code, - check_digits: check_digits, - bank_code: bank_code, - branch_code: _branch_code, - national_check: _national_check, - account_number: account_number - } = _iban, - joiner \\ " " - ) do - [country_code, check_digits, bank_code, account_number] - |> Enum.join(joiner) - end + use IbanEx.Country.Template end