Class: Statefully::State::Success
- Inherits:
-
Statefully::State
- Object
- Statefully::State
- Statefully::State::Success
- Defined in:
- lib/statefully/state.rb
Overview
Success is a not-yet failed Statefully::State.
Instance Attribute Summary
Attributes inherited from Statefully::State
Instance Method Summary collapse
-
#fail(error) ⇒ State::Failure
Return the next, failed Statefully::State with a stored error.
-
#finish ⇒ State::State
Return the next, finished? Statefully::State.
-
#succeed(**values) ⇒ State::Success
Return the next, successful Statefully::State with new values merged in (if any).
Methods inherited from Statefully::State
create, #diff, #each, #failed?, #fetch, #finished?, #history, #inspect, #key?, #keys, #none?, #resolve, #successful?
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Statefully::State
Instance Method Details
#fail(error) ⇒ State::Failure
Return the next, failed Statefully::State with a stored error
353 354 355 |
# File 'lib/statefully/state.rb', line 353 def fail(error) Failure.send(:new, _members, error, previous: self).freeze end |
#finish ⇒ State::State
Return the next, finished? Statefully::State
364 365 366 |
# File 'lib/statefully/state.rb', line 364 def finish Finished.send(:new, _members, previous: self).freeze end |
#succeed(**values) ⇒ State::Success
Return the next, successful Statefully::State with new values merged in (if any)
340 341 342 |
# File 'lib/statefully/state.rb', line 340 def succeed(**values) self.class.send(:new, _members.merge(values).freeze, previous: self) end |