Class: Trailblazer::Activity::DSL::Linear::VariableMapping::Pipe::Input
- Inherits:
-
Object
- Object
- Trailblazer::Activity::DSL::Linear::VariableMapping::Pipe::Input
- Defined in:
- lib/trailblazer/activity/dsl/linear/feature/variable_mapping/runtime.rb
Direct Known Subclasses
Instance Method Summary collapse
- #call(wrap_ctx, original_args) ⇒ Object
-
#initialize(pipe, id: :vm_original_ctx) ⇒ Input
constructor
A new instance of Input.
Constructor Details
#initialize(pipe, id: :vm_original_ctx) ⇒ Input
Returns a new instance of Input.
13 14 15 16 |
# File 'lib/trailblazer/activity/dsl/linear/feature/variable_mapping/runtime.rb', line 13 def initialize(pipe, id: :vm_original_ctx) @pipe = pipe @id = id end |
Instance Method Details
#call(wrap_ctx, original_args) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/trailblazer/activity/dsl/linear/feature/variable_mapping/runtime.rb', line 18 def call(wrap_ctx, original_args) (original_ctx, ), = original_args # let user compute new ctx for the wrapped task. pipe_ctx, _ = @pipe.({original_ctx: original_ctx, aggregate: {}}, original_args) ctx_from_input = pipe_ctx[:input_ctx] wrap_ctx = wrap_ctx.merge(@id => original_ctx) # remember the original ctx under the key {@id}. # instead of the original Context, pass on the filtered `ctx_from_input` in the wrap. return wrap_ctx, [[ctx_from_input, ], ] end |