class Servicify::Common::Errors

Public Instance Methods

add(key, value, _opts = {}) click to toggle source
# File lib/servicify/common/errors.rb, line 4
def add(key, value, _opts = {})
  self[key] ||= []
  self[key] << value
  self[key].uniq!
end
add_multiple_errors(errors_hash) click to toggle source
# File lib/servicify/common/errors.rb, line 10
def add_multiple_errors(errors_hash)
  errors_hash.each do |key, values|
    errors_hash[key].each { |value| add key, value }
  end
end
each() { |field, message| ... } click to toggle source
# File lib/servicify/common/errors.rb, line 16
def each
  each_key do |field|
    self[field].each { |message| yield field, message }
  end
end