Module: Validate::Validators::DSL
Instance Method Summary collapse
Methods included from Arguments
Instance Method Details
#create(&block) ⇒ Object
13 14 15 |
# File 'lib/validate/validators/dsl.rb', line 13 def create(&block) Validator.new(&block) end |
#define(name, &body) ⇒ Object
9 10 11 |
# File 'lib/validate/validators/dsl.rb', line 9 def define(name, &body) Scope.current.register_validator(name, create(&body)) end |
#none ⇒ Object
17 18 19 |
# File 'lib/validate/validators/dsl.rb', line 17 def none @none ||= Validator::None.new end |