Module: Validate::ClassMethods

Defined in:
lib/validate.rb

Instance Method Summary collapse

Instance Method Details

#validations(&block) ⇒ Object

Doubles as setter & getter for @validations This method is also the main interface to this lib.



13
14
15
16
17
# File 'lib/validate.rb', line 13

def validations(&block)
  return @validator unless block
  validations = Parser.parse(&block)
  @validator = Validator.new(validations)
end