Module: Cuprum::ResultHelpers
- Included in:
- Command
- Defined in:
- lib/cuprum/result_helpers.rb
Overview
Helper methods that delegate result methods to the currently processed result.
Instance Method Summary collapse
-
#errors ⇒ Array, Object
Provides a reference to the current result’s errors object.
-
#failure! ⇒ Object
Marks the current result as failed.
-
#halt! ⇒ Object
Marks the current result as halted.
-
#success! ⇒ Object
Marks the current result as passing.
Instance Method Details
#errors ⇒ Array, Object
This is a private method, and only available when executing the command implementation as defined in the constructor block or the #process method.
Provides a reference to the current result’s errors object. Messages or error objects added to this will be included in the #errors method of the returned result object.
66 67 68 |
# File 'lib/cuprum/result_helpers.rb', line 66 def errors result&.errors end |
#failure! ⇒ Object
This is a private method, and only available when executing the command implementation as defined in the constructor block or the #process method.
Marks the current result as failed. Calling #failure? on the returned result object will evaluate to true, whether or not the result has any errors.
81 82 83 |
# File 'lib/cuprum/result_helpers.rb', line 81 def failure! result&.failure! end |
#halt! ⇒ Object
This is a private method, and only available when executing the command implementation as defined in the constructor block or the #process method.
Marks the current result as halted.
94 95 96 |
# File 'lib/cuprum/result_helpers.rb', line 94 def halt! result&.halt! end |
#success! ⇒ Object
This is a private method, and only available when executing the command implementation as defined in the constructor block or the #process method.
Marks the current result as passing. Calling #success? on the returned result object will evaluate to true, whether or not the result has any errors.
109 110 111 |
# File 'lib/cuprum/result_helpers.rb', line 109 def success! result&.success! end |