Class: Trailblazer::Loader::Pipeline::Collect
- Inherits:
-
Trailblazer::Loader::Pipeline
- Object
- Array
- Trailblazer::Loader::Pipeline
- Trailblazer::Loader::Pipeline::Collect
- Defined in:
- lib/trailblazer/loader/pipeline.rb
Overview
Collect applies a pipeline to each element of input.
Constant Summary
Constants inherited from Trailblazer::Loader::Pipeline
Instance Method Summary collapse
-
#call(input, options) ⇒ Object
when stop, the element is skipped.
Methods included from Macros
Instance Method Details
#call(input, options) ⇒ Object
when stop, the element is skipped. (should that be Skip then?)
33 34 35 36 37 38 39 40 |
# File 'lib/trailblazer/loader/pipeline.rb', line 33 def call(input, ) arr = [] input.each_with_index do |item_fragment, i| result = super(item_fragment, .merge(index: i)) # DISCUSS: NO :fragment set. Stop == result ? next : arr << result end arr end |