Errors represents validation errors, a simple hash subclass with a few convenience methods.
Assign an array of messages for each attribute on access
# File lib/sequel/model/errors.rb, line 9 def [](k) has_key?(k) ? super : (self[k] = []) end
Adds an error for the given attribute.
# File lib/sequel/model/errors.rb, line 14 def add(att, msg) self[att] << msg end
Return the total number of error messages.
# File lib/sequel/model/errors.rb, line 19 def count values.inject(0){|m, v| m + v.length} end
Return true if there are no error messages, false otherwise.
# File lib/sequel/model/errors.rb, line 24 def empty? count == 0 end
Generated with the Darkfish Rdoc Generator 2.