Module: Errorio::ErrorObjectsMethods

Defined in:
lib/errorio.rb

Overview

Methods for Error object

Instance Method Summary collapse

Instance Method Details

#to_eObject



196
197
198
199
200
201
202
203
204
205
# File 'lib/errorio.rb', line 196

def to_e
  result = []

  @errors.each do |err|
    msg = err.options.key?(:message) ? err.options[:message] : err.message
    err_obj = err.options.merge(key: err.attribute, type: err.type, message: msg)
    result << err_obj
  end
  result
end