countries v1.6.0 Countries View Source

Link to this section Summary

Functions

Returns all countries

Checks if country for specific attribute and value exists

Filters countries by given attribute

Returns one country gived is alpha2 country code

Link to this section Functions

Returns all countries.

Link to this function

exists?(attribue, value) View Source

Checks if country for specific attribute and value exists.

Returns boolean

Examples

iex> Countries.exists?(:name, "Poland") true

iex> Countries.exists?(:name, "Polande") false

Link to this function

filter_by(attribute, value) View Source

Filters countries by given attribute.

Returns a list of Countries.Country structs

Examples

iex> Countries.filter_by(:region, "Europe") [%Countries.Country{address_format: nil, alpha2: "VA" ...

iex> Countries.filter_by(:names, "Reino Unido") [%Countries.Country{address_format: nil, alpha2: "GB" ...

Returns one country gived is alpha2 country code