Funx.Validator.Integer (funx v0.8.0)

View Source

Validates that a value is an integer.

Optional Options

  • :message - Custom error message callback (value -> String.t())

Examples

iex> Funx.Validator.Integer.validate(5)
%Funx.Monad.Either.Right{right: 5}

iex> Funx.Validator.Integer.validate(5.5)
%Funx.Monad.Either.Left{left: %Funx.Errors.ValidationError{errors: ["must be an integer"]}}

Summary

Functions

validate(value)

validate(value, opts)