StrawHat.Map v1.2.0 StrawHat.Map.Country View Source

Represents a Country Ecto Schema with functionality about the data validation for Country.

Link to this section Summary

Types

Check t/0 type for more information about the keys

t()
  • name: Name of the country.
  • iso_two: Two characters ISO code.
  • iso_three: Three characters ISO code.
  • iso_numeric: Numeric ISO code.
  • has_counties: Defines if the country has counties.
  • continent: Two characters continent code.
  • states: List of StrawHat.Map.States.t/0 associated with the country.
  • postal_code_rule: A regular expression that specifies a valid postal code

Functions

Validates the attributes and return a Ecto.Changeset for the current Country

Link to this section Types

Link to this type country_attrs() View Source
country_attrs() :: %{
  name: String.t(),
  iso_two: String.t(),
  iso_three: String.t(),
  iso_numeric: String.t(),
  continent: String.t(),
  has_counties: boolean(),
  postal_code_rule: StrawHat.Map.Ecto.Regex.t()
}

Check t/0 type for more information about the keys.

Link to this type t() View Source
t() :: %StrawHat.Map.Country{
  __meta__: term(),
  continent: String.t(),
  has_counties: boolean(),
  id: term(),
  inserted_at: term(),
  iso_numeric: String.t(),
  iso_three: String.t(),
  iso_two: String.t(),
  name: String.t(),
  postal_code_rule: StrawHat.Map.Ecto.Regex.t(),
  states: [StrawHat.Map.State.t()] | Ecto.Association.NotLoaded.t(),
  updated_at: term()
}
  • name: Name of the country.
  • iso_two: Two characters ISO code.
  • iso_three: Three characters ISO code.
  • iso_numeric: Numeric ISO code.
  • has_counties: Defines if the country has counties.
  • continent: Two characters continent code.
  • states: List of StrawHat.Map.States.t/0 associated with the country.
  • postal_code_rule: A regular expression that specifies a valid postal code.

Link to this section Functions

Link to this function changeset(country, country_attrs) View Source
changeset(t(), country_attrs()) :: Ecto.Changeset.t()

Validates the attributes and return a Ecto.Changeset for the current Country.