Class: Navigable::Errors

Inherits:
Object
  • Object
show all
Defined in:
lib/navigable/errors.rb

Instance Method Summary collapse

Constructor Details

#initializeErrors

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, message)
  @errors[field] << message
end

#empty?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/navigable/errors.rb', line 13

def empty?
  @errors.empty?
end