validation.rb

Path: lib/assistance/validation.rb
Last Update: Mon Aug 16 12:57:39 -0600 2010

The Validations module provides validation capabilities as a mixin. When included into a class, it enhances the class with class and instance methods for defining validations and validating class instances.

The Validation emulates the validation capabilities of ActiveRecord, and provides methods for validating acceptance, confirmation, presence, format, length and numericality of attributes.

To use validations, you need to include the Validation module in your class:

  class MyClass
    include Validation
    validates_length_of :password, :minimum => 6
  end

[Validate]