View Source Veli.Validators.Type (Veli v0.2.6)

Type validator. Takes an atom that contains type information.

atoms

Atoms

  • :string
  • :integer
  • :float
  • :boolean

example

Example

rule = [type: :integer]
Veli.valid(2, rule) # valid
Veli.valid(4.2, rule) # not valid

Link to this section Summary

Link to this section Functions

@spec valid?(any(), atom()) :: boolean()