Class: Cavalry::Error
- Inherits:
-
Object
- Object
- Cavalry::Error
- Defined in:
- lib/cavalry/error.rb
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize(record) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(record) ⇒ Error
Returns a new instance of Error.
5 6 7 8 |
# File 'lib/cavalry/error.rb', line 5 def initialize(record) @record = record dump end |
Instance Method Details
#dump ⇒ Object
10 11 12 13 14 15 |
# File 'lib/cavalry/error.rb', line 10 def dump { record: @record.class.name }.tap do |h| h.merge!(attributes: @record.attributes) if @record.respond_to?(:attributes) h.merge!(errors: errors.to_hash) end end |