Class: Mutations::YoValidationException

Inherits:
ValidationException show all
Defined in:
lib/mutations_validate_outcome.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ValidationException

#inspect, #message

Constructor Details

#initialize(e, owner = nil) ⇒ YoValidationException

Returns a new instance of YoValidationException.



70
71
72
73
# File 'lib/mutations_validate_outcome.rb', line 70

def initialize(e, owner = nil)
  super(e.is_a?(ValidationException) ? e.errors : Mutations::ErrorHash[error: Mutations::ErrorAtom.new(e.message.to_sym, e.class.name.to_sym, message: e.message)])
  @cause, @owner = e, owner || caller
end

Instance Attribute Details

#causeObject (readonly)

Returns the value of attribute cause.



69
70
71
# File 'lib/mutations_validate_outcome.rb', line 69

def cause
  @cause
end

#ownerObject (readonly)

Returns the value of attribute owner.



69
70
71
# File 'lib/mutations_validate_outcome.rb', line 69

def owner
  @owner
end