Module: Mixture::Extensions::Validatable::ClassMethods

Defined in:
lib/mixture/extensions/validatable.rb

Overview

The class methods.

Instance Method Summary collapse

Instance Method Details

#validate(name, options = {}) ⇒ Object

Creates a new validation for the given attribute. The attribute must be defined before this call, otherwise it will error.



13
14
15
# File 'lib/mixture/extensions/validatable.rb', line 13

def validate(name, options = {})
  attributes.fetch(name).options[:validate] = options
end