Path: | lib/assistance/validation.rb |
Last Update: | Sun Mar 01 23:07:20 -0700 2009 |
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