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
#ancestry, 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
375 376 377 |
# File 'lib/statefully/state.rb', line 375 def fail(error) Failure.send(:new, _members, error, previous: self).freeze end |
#finish ⇒ State::State
Return the next, finished? Statefully::State
386 387 388 |
# File 'lib/statefully/state.rb', line 386 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)
362 363 364 |
# File 'lib/statefully/state.rb', line 362 def succeed(**values) self.class.send(:new, _members.merge(values).freeze, previous: self) end |