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

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.