holidefs v0.3.2 Holidefs.Definition View Source

A definition is a set of rules for the holiday events in the year.

Link to this section Summary

Functions

Returns the path for the given locale definition file

Returns the list of regions from the definition.

Loads the definition for a locale code and name.

Returns the path where all the locale definitions are saved

Link to this section Types

Specs

t() :: %Holidefs.Definition{
  code: atom(),
  name: String.t(),
  rules: [Holidefs.Definition.Rule.t()]
}

Link to this section Functions

Link to this function

file_path(code, path \\ path())

View Source

Specs

file_path(atom(), Path.t()) :: binary()

Returns the path for the given locale definition file

Specs

get_regions(t()) :: [String.t()]

Returns the list of regions from the definition.

Specs

load!(atom(), String.t()) :: t()

Loads the definition for a locale code and name.

If any definition rule is invalid, a RuntimeError will be raised

Specs

path() :: Path.t()

Returns the path where all the locale definitions are saved