Top Level Namespace
Defined in:
Macro Summary
- is(name, *args)
-
is!(name, *args)
Same as
is
butraise
aValidator::Error
displaying 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?, "[email protected]" # => true
is "email?", "[email protected]" # => 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 :)