Class: Statefully::State::Failure
- Inherits:
-
Statefully::State
- Object
- Statefully::State
- Statefully::State::Failure
- Defined in:
- lib/statefully/state.rb
Overview
Failure is a failed State.
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Attributes inherited from Statefully::State
Instance Method Summary collapse
- #diff ⇒ Object
-
#initialize(values, error, previous:) ⇒ Failure
constructor
A new instance of Failure.
- #inspect ⇒ Object
- #resolve ⇒ Object
- #success? ⇒ Boolean
Methods inherited from Statefully::State
Constructor Details
#initialize(values, error, previous:) ⇒ Failure
Returns a new instance of Failure.
107 108 109 110 |
# File 'lib/statefully/state.rb', line 107 def initialize(values, error, previous:) super(values, previous: previous) @error = error end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Statefully::State
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
105 106 107 |
# File 'lib/statefully/state.rb', line 105 def error @error end |
Instance Method Details
#diff ⇒ Object
112 113 114 |
# File 'lib/statefully/state.rb', line 112 def diff error end |
#inspect ⇒ Object
124 125 126 |
# File 'lib/statefully/state.rb', line 124 def inspect inspect_details(error: error.inspect) end |
#resolve ⇒ Object
120 121 122 |
# File 'lib/statefully/state.rb', line 120 def resolve raise error end |
#success? ⇒ Boolean
116 117 118 |
# File 'lib/statefully/state.rb', line 116 def success? false end |