Class: Trailblazer::Macro::Nested::Decider
- Inherits:
-
Object
- Object
- Trailblazer::Macro::Nested::Decider
- Defined in:
- lib/trailblazer/macro/nested.rb
Overview
TaskWrap step to run the decider. It’s part of the API that the decider sees the original ctx. So this has to be placed in tW because we this step needs to be run before In() filters to resemble the behavior from pre 2.1.12.
Instance Method Summary collapse
-
#call(wrap_ctx, original_args) ⇒ Object
TaskWrap API.
-
#initialize(nested_activity_decider) ⇒ Decider
constructor
A new instance of Decider.
Constructor Details
#initialize(nested_activity_decider) ⇒ Decider
Returns a new instance of Decider.
55 56 57 |
# File 'lib/trailblazer/macro/nested.rb', line 55 def initialize(nested_activity_decider) @nested_activity_decider = Activity::Circuit.Step(nested_activity_decider, option: true) end |
Instance Method Details
#call(wrap_ctx, original_args) ⇒ Object
TaskWrap API.
60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/trailblazer/macro/nested.rb', line 60 def call(wrap_ctx, original_args) (ctx, ), = original_args # FIXME: allow calling a Step task without the Binary decision (in Activity::TaskAdapter). nested_activity, _ = @nested_activity_decider.([ctx, ], **) # no TaskWrap::Runner because we shall not trace! = .merge( decision: nested_activity ) return wrap_ctx, [[ctx, ], ] end |