module Mixture::Extensions::Validatable::ClassMethods

The class methods.

Public Instance Methods

validate(name, options = {}) click to toggle source

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

@param name [Symbol] The name of the attribute to validate. @param options [Hash] The options for validation. This is

normally a key-value pair, where the key is the name of
the validator, and the value is the options to pass to
the validator.

@return [void]

# File lib/mixture/extensions/validatable.rb, line 21
def validate(name, options = {})
  attributes.fetch(name).options[:validate] = options
end