Location v0.0.1 Location.Region View Source
A region based on UN M.49.
Sources
Link to this section Summary
Functions
List all subregions of a given region.
List all countries in a region.
Find a region based on UN M.49 number or name.
List all known regions.
Find the parent region of a region.
Link to this section Types
Link to this type
region_id()
View Source
region_id()
View Source
region_id() :: pos_integer() | String.t()
region_id() :: pos_integer() | String.t()
A region identifier.
It can be a UN M.49 number or name.
Link to this type
t()
View Source
t()
View Source
t() :: %Location.Region{
code: pos_integer(),
name: String.t(),
parent: pos_integer()
}
t() :: %Location.Region{ code: pos_integer(), name: String.t(), parent: pos_integer() }
A region based on UN M.49.
Sources
Link to this section Functions
Link to this function
children(lookup) View Source
List all subregions of a given region.
Returns []
if the region has no subregions.
Link to this function
countries(lookup)
View Source
countries(lookup)
View Source
countries(t() | region_id()) :: [Location.Country.t()]
countries(t() | region_id()) :: [Location.Country.t()]
List all countries in a region.
Link to this function
find(name) View Source
Find a region based on UN M.49 number or name.
Link to this function
list()
View Source
list()
View Source
list() :: [t()]
list() :: [t()]
List all known regions.
Link to this function
parent(lookup) View Source
Find the parent region of a region.
Returns nil
if the region has no parent.