LivePhone.Country.from_iso

You're seeing just the function from_iso, go back to LivePhone.Country module for more information.

Specs

from_iso({String.t(), %{required(String.t()) => String.t()}}) :: t()

Converts the given iso_country tuple into a LivePhone.Country struct.

Examples

iex> ISO.countries() |> Map.to_list() |> Enum.find(fn {cc, _} -> cc == "SL" end) |> LivePhone.Country.from_iso()
%LivePhone.Country{
  preferred: false,
  region_code: "232",
  flag_emoji: "πŸ‡ΈπŸ‡±",
  code: "SL",
  name: "Sierra Leone"
}

iex> LivePhone.Country.from_iso({"US", %{"name" => "United States"}})
%LivePhone.Country{
  preferred: false,
  region_code: "1",
  flag_emoji: "πŸ‡ΊπŸ‡Έ",
  code: "US",
  name: "United States"
}