View Source LivePhone.Country (live_phone v0.6.0)
The LivePhone.Country
struct holds minimal information about a country, but
it should be enough data for LivePhone
to work it's magic.
Link to this section Summary
Functions
Converts the given iso_country
tuple into a LivePhone.Country
struct.
Link to this section Types
Link to this section Functions
Converts the given iso_country
tuple into a LivePhone.Country
struct.
examples
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"
}