Location v0.0.1 Location.Region View Source

A region based on UN M.49.

Sources

Link to this section Summary

Types

A region identifier.

t()

A region based on UN M.49.

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() :: 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() :: %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
children(t() | region_id()) :: [t()]

List all subregions of a given region.

Returns [] if the region has no subregions.

Link to this function

countries(lookup) View Source
countries(t() | region_id()) :: [Location.Country.t()]

List all countries in a region.

Link to this function

find(name) View Source
find(region_id()) :: t() | nil

Find a region based on UN M.49 number or name.

List all known regions.

Link to this function

parent(lookup) View Source
parent(t()) :: t() | nil

Find the parent region of a region.

Returns nil if the region has no parent.