Validation::Errors represents validation errors.
Adds an error for the given attribute.
# File lib/assistance/validation.rb, line 63 def add(att, msg) @errors[att] << msg end
Clears all errors.
# File lib/assistance/validation.rb, line 52 def clear @errors.clear end
Returns true if no errors are stored.
# File lib/assistance/validation.rb, line 47 def empty? @errors.empty? end
Returns an array of fully-formatted error messages.
# File lib/assistance/validation.rb, line 68 def full_messages @errors.inject([]) do |m, kv| att, errors = *kv errors.each {|e| m << "#{att} #{e}"} m end end
Returns the errors for the given attribute.
# File lib/assistance/validation.rb, line 57 def on(att) @errors[att] end
Generated with the Darkfish Rdoc Generator 2.