module Veto::Validator::ClassMethods

Public Instance Methods

check_with(val) click to toggle source
# File lib/veto/validator.rb, line 20
def check_with(val)
  @checker = val
end
checker() click to toggle source
# File lib/veto/validator.rb, line 24
def checker
  @checker ||= build_checker
end
validate(*args) click to toggle source
# File lib/veto/validator.rb, line 16
def validate(*args)
  checker.validate(*args)
end
validates(*args) click to toggle source
# File lib/veto/validator.rb, line 12
def validates(*args)
  checker.validates(*args)
end
with_options(*args, &block) click to toggle source
# File lib/veto/validator.rb, line 8
def with_options(*args, &block)
  checker.with_options(*args, &block)
end

Private Instance Methods

build_checker(children=[]) click to toggle source
# File lib/veto/validator.rb, line 30
def build_checker(children=[])
  Checker.from_children(children)
end
inherited(descendant) click to toggle source
# File lib/veto/validator.rb, line 34
def inherited(descendant)
  descendant.check_with(build_checker(checker.children.dup))
end