Class: Logicall::Result
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Logicall::Result
- Defined in:
- lib/logicall/result.rb
Overview
Represents the result with all the values, the result is considered success by default.
Instance Method Summary collapse
-
#fail! ⇒ Object
Marks the result as a failure.
-
#failure? ⇒ Boolean
Indicates whether the result is a failure or not.
-
#success? ⇒ Boolean
Indicates whether the result is a success or not.
Instance Method Details
#fail! ⇒ Object
Marks the result as a failure.
17 18 19 |
# File 'lib/logicall/result.rb', line 17 def fail! @failure = true end |
#failure? ⇒ Boolean
Indicates whether the result is a failure or not
12 13 14 |
# File 'lib/logicall/result.rb', line 12 def failure? @failure || false end |
#success? ⇒ Boolean
Indicates whether the result is a success or not.
7 8 9 |
# File 'lib/logicall/result.rb', line 7 def success? !failure? end |