LivePhone.Country (live_phone v0.1.1) View Source
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
Specs
Link to this section Functions
Specs
Converts the given iso_country
tuple into a LivePhone.Country
struct.
Examples
iex> ISO.countries() |> Map.to_list() |> List.first() |> 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"
}