View Source Parameter.Types (Parameter v0.4.1)

Type behavour for implementing new types for parameters.

Link to this section Summary

Link to this section Types

@type base_types() ::
  :string
  | :atom
  | :boolean
  | :date
  | :datetime
  | :decimal
  | :float
  | :integer
  | :map
  | :naive_datetime
  | :string
  | :time
@type composite_types() :: {:has_many, t()} | {:has_one, t()}
@type t() :: base_types() | composite_types()

Link to this section Functions

@spec base_types() :: [atom()]
@spec composite_types() :: [atom()]
@spec dump(atom(), any()) :: {:ok, any()} | {:error, any()}
@spec load(atom(), any()) :: {:ok, any()} | {:error, any()}
@spec validate(atom(), any()) :: :ok | {:error, any()}
@spec validate!(atom(), any()) :: :ok | no_return()