countries v1.4.3 Countries

Summary

Functions

Returns all countries

Checks if country for specific attribute and value exists

Filters countries by given attribute

Functions

all()

Returns all countries.

exists?(attribue, value)

Checks if country for specific attribute and value exists.

Returns boolean

Examples

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

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

filter_by(attribute, value)

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” …