Class: Mediate::ErrorHandlerState
- Inherits:
-
Object
- Object
- Mediate::ErrorHandlerState
- Defined in:
- lib/mediate/error_handler_state.rb
Overview
Represents the result of handling an exception
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#handled? ⇒ Boolean
Indicates whether the current exception has been handled and the result should be returned (if applicable).
-
#set_as_handled(result = nil) ⇒ Boolean
Sets the state as handled with the given result.
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
8 9 10 |
# File 'lib/mediate/error_handler_state.rb', line 8 def result @result end |
Instance Method Details
#handled? ⇒ Boolean
Indicates whether the current exception has been handled and the result should be returned (if applicable).
28 29 30 |
# File 'lib/mediate/error_handler_state.rb', line 28 def handled? !!@handled end |
#set_as_handled(result = nil) ⇒ Boolean
Sets the state as handled with the given result. Subsequent error handlers will be skipped and, if
the exception was thrown while handling a Mediate::Request, this result will be returned.
18 19 20 21 |
# File 'lib/mediate/error_handler_state.rb', line 18 def set_as_handled(result = nil) @result = result @handled = true end |