Class: Trailblazer::Activity::DSL::Linear::VariableMapping::Output::Unscoped
- Inherits:
-
Object
- Object
- Trailblazer::Activity::DSL::Linear::VariableMapping::Output::Unscoped
- Defined in:
- lib/trailblazer/activity/dsl/linear/variable_mapping.rb
Overview
Merge the resulting @filter@filter.() hash back into the original ctx. DISCUSS: do we need the original_ctx as a filter argument?
Direct Known Subclasses
Defined Under Namespace
Classes: WithOuterContext
Instance Method Summary collapse
-
#call(new_ctx, original_ctx, flow_options, **circuit_options) ⇒ Object
The returned hash from @filter is merged with the original ctx.
- #call_filter(new_ctx, _original_ctx, _flow_options, **circuit_options) ⇒ Object
-
#initialize(filter) ⇒ Unscoped
constructor
A new instance of Unscoped.
Constructor Details
#initialize(filter) ⇒ Unscoped
Returns a new instance of Unscoped.
212 213 214 |
# File 'lib/trailblazer/activity/dsl/linear/variable_mapping.rb', line 212 def initialize(filter) @filter = filter end |
Instance Method Details
#call(new_ctx, original_ctx, flow_options, **circuit_options) ⇒ Object
The returned hash from @filter is merged with the original ctx.
217 218 219 220 221 |
# File 'lib/trailblazer/activity/dsl/linear/variable_mapping.rb', line 217 def call(new_ctx, (original_ctx, ), **) original_ctx.merge( call_filter(new_ctx, [original_ctx, ], **) ) end |
#call_filter(new_ctx, _original_ctx, _flow_options, **circuit_options) ⇒ Object
223 224 225 226 |
# File 'lib/trailblazer/activity/dsl/linear/variable_mapping.rb', line 223 def call_filter(new_ctx, (_original_ctx, ), **) # Pass {inner_ctx, **inner_ctx} @filter.(new_ctx, keyword_arguments: new_ctx.to_hash, **) end |