Talos v1.6.2 Talos.Types.FixedType View Source
Fixed type is used to check value to be equal expected
For example:
iex> import Talos, only: [fixed: 1]
iex> the_4th_planet = fixed(value: "Mars")
iex> Talos.valid?(the_4th_planet, "Earth")
false
iex> Talos.valid?(the_4th_planet, "Mars")
true
Additional parameters:
allow_nil
- allows value to be nil
Link to this section Summary
Functions
Callback implementation for Talos.Types.errors/2
.
Callback implementation for Talos.Types.valid?/2
.
Link to this section Types
Link to this section Functions
Callback implementation for Talos.Types.errors/2
.
Link to this function
valid?(type, value)
View Sourcevalid?(Talos.Types.FixedType.t(), any()) :: boolean()
Callback implementation for Talos.Types.valid?/2
.