Top Level Namespace
Defined in:
Macro Summary
- is(name, *args)
-
is!(name, *args)
Same as
isbutraiseaValidator::Errordisplaying an inspection if the validation isfalse.
Macro Detail
macro is(name, *args)
#
An (optional) expressive flavor of Validator (or Valid alias).
Not exposed by default, must be imported:
require "validator/is"
is :email?, "contact@example.org" # => true
is "email?", "contact@example.org" # => true
is :url?, "https://github.com/Nicolab/crystal-validator" # => true
macro is!(name, *args)
#
Same as is but raise a Validator::Error
displaying an inspection if the validation is false.
Useful for the unit tests :)