Module: Mixture::Extensions::Validatable::ClassMethods
- Defined in:
- lib/mixture/extensions/validatable.rb
Overview
The class methods.
Instance Method Summary collapse
-
#validate(name, options = {}) ⇒ void
Creates a new validation for the given attribute.
Instance Method Details
#validate(name, options = {}) ⇒ void
This method returns an undefined value.
Creates a new validation for the given attribute. The attribute must be defined before this call, otherwise it will error.
21 22 23 |
# File 'lib/mixture/extensions/validatable.rb', line 21 def validate(name, = {}) attributes.fetch(name).[:validate] = end |