Module: Validate::Validators::DSL

Includes:
Arguments
Included in:
Validate::Validators
Defined in:
lib/validate/validators/dsl.rb

Instance Method Summary collapse

Methods included from Arguments

included

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

#noneObject



17
18
19
# File 'lib/validate/validators/dsl.rb', line 17

def none
  @none ||= Validator::None.new
end