Module: Mixture::Extensions::Validatable::ClassMethods
- Defined in:
- lib/mixture/extensions/validatable.rb
Overview
The class methods.
Instance Method Summary collapse
-
#validate(name, options = {}) ⇒ Object
Creates a new validation for the given attribute.
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, = {}) attributes.fetch(name).[:validate] = end |