Class: Dinamo::Model::Errors
- Inherits:
-
Hash
- Object
- Hash
- Dinamo::Model::Errors
- Defined in:
- lib/dinamo/model/errors.rb
Instance Method Summary collapse
Instance Method Details
#add(attribute, message) ⇒ Object
4 5 6 |
# File 'lib/dinamo/model/errors.rb', line 4 def add(attribute, ) fetch(attribute) { self[attribute] = [] } << end |
#count ⇒ Object
8 9 10 |
# File 'lib/dinamo/model/errors.rb', line 8 def count values.inject(0) { |all, value| all + value.length } end |
#empty? ⇒ Boolean
12 13 14 |
# File 'lib/dinamo/model/errors.rb', line 12 def empty? count.zero? end |