ecto_fields v1.3.0 EctoFields.Atom
Coerce a regular string into an atom
Examples
Note: only use this field when you have a fixed number of possible values (atoms are not garbage collected)
iex> EctoFields.Atom.cast("started")
{:ok, :started}
iex> EctoFields.Atom.cast(:started)
{:ok, :started}
iex> EctoFields.Atom.cast(nil)
{:ok, nil}
Link to this section Summary
Functions
Callback implementation for Ecto.Type.cast/1
.
Callback implementation for Ecto.Type.dump/1
.
Callback implementation for Ecto.Type.equal?/2
.
Callback implementation for Ecto.Type.load/1
.
Callback implementation for Ecto.Type.type/0
.
Link to this section Functions
Link to this function
cast(atom)
Callback implementation for Ecto.Type.cast/1
.
Link to this function
dump(atom)
Callback implementation for Ecto.Type.dump/1
.
Link to this function
embed_as(_)
Link to this function
equal?(a, b)
Callback implementation for Ecto.Type.equal?/2
.
Link to this function
load(term)
Callback implementation for Ecto.Type.load/1
.
Link to this function
type()
Callback implementation for Ecto.Type.type/0
.