want v1.1.1 Want.Atom
Performs type conversions to atom values.
Link to this section Summary
Link to this section Types
Link to this section Functions
Cast a value to an atom.
Options
:exists
- If true, only convert to an atom if a matching atom already exists.
Examples
iex> Want.Atom.cast("hello")
iex> Want.Atom.cast(1.0)
iex> Want.Atom.cast({:a, :b}) {:error, "Failed to convert value {:a, :b} to atom."}
iex> Want.Atom.cast("10", exists: true)
Callback implementation for Want.Type.cast/2
.