Class: Linearly::Mixins::StepCollection::Reducer Private
- Inherits:
-
Object
- Object
- Linearly::Mixins::StepCollection::Reducer
- Defined in:
- lib/linearly/mixins/step_collection.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Reducer encapsulates the logic required to process a single Step in a larger collection.
Class Method Summary collapse
-
.reduce(input, step) ⇒ Statefully::State
private
Public interface for the Reducer.
Instance Method Summary collapse
-
#reduce ⇒ Statefully::State
private
Internal Reducer method to create Step output.
Class Method Details
.reduce(input, step) ⇒ Statefully::State
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Public interface for the Linearly::Mixins::StepCollection::Reducer
34 35 36 |
# File 'lib/linearly/mixins/step_collection.rb', line 34 def self.reduce(input, step) new(input: input, step: step).reduce end |
Instance Method Details
#reduce ⇒ Statefully::State
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Internal Reducer method to create Step output
42 43 44 45 46 |
# File 'lib/linearly/mixins/step_collection.rb', line 42 def reduce return input if input.failed? || input.finished? return input.fail(bad_output_error) unless state_returned? output end |