DValidate.ValidateType (d_validate v1.1.0)

Summary

Functions

Validates if a value is of the specified type.

Functions

Link to this function

call(value, type)

Validates if a value is of the specified type.

Examples

iex> DValidate.ValidateType.call(1, :integer)
:ok

iex> DValidate.ValidateType.call("value", :string)
:ok

iex> DValidate.ValidateType.call(1.0, :float)
:ok

iex> DValidate.ValidateType.call("value", :integer)
{:error, :integer, "is invalid"}