View Source Vx.Integer (Vx v0.3.0)
The Integer type.
Summary
Types
@opaque t()
The integer type.
Functions
@spec t() :: t()
Builds a new Integer type.
Examples
iex> Vx.Integer.t() |> Vx.validate!(1)
:ok
iex> Vx.Integer.t() |> Vx.validate!(1.0)
** (Vx.Error) must be an integer
iex> Vx.Integer.t() |> Vx.validate!("foo")
** (Vx.Error) must be an integer