Class: Navigable::Errors
- Inherits:
-
Object
- Object
- Navigable::Errors
- Defined in:
- lib/navigable/errors.rb
Instance Method Summary collapse
- #add(field, message) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize ⇒ Errors
constructor
A new instance of Errors.
Constructor Details
#initialize ⇒ Errors
Returns a new instance of Errors.
5 6 7 |
# File 'lib/navigable/errors.rb', line 5 def initialize() @errors = Hash.new { |h, k| h[k] = [] } end |
Instance Method Details
#add(field, message) ⇒ Object
9 10 11 |
# File 'lib/navigable/errors.rb', line 9 def add(field, ) @errors[field] << end |
#empty? ⇒ Boolean
13 14 15 |
# File 'lib/navigable/errors.rb', line 13 def empty? @errors.empty? end |