Class: Trailblazer::Activity::Circuit::Step::Option

Inherits:
Trailblazer::Activity::Circuit::Step show all
Defined in:
lib/trailblazer/activity/circuit/task_adapter.rb

Overview

In Option, @step is expected to be wrapped in a Option. To remember: when calling an Option instance, you need to pass :keyword_arguments explicitely, because of beautiful Ruby 2.5 and 2.6.

This is often needed for “decider” chunks where the user can run either a method or a callable but you only want back the return value, not a Binary circuit-interface return set.

Instance Method Summary collapse

Methods inherited from Trailblazer::Activity::Circuit::Step

#initialize

Constructor Details

This class inherits a constructor from Trailblazer::Activity::Circuit::Step

Instance Method Details

#call(ctx, _flow_options, **circuit_options) ⇒ Object



44
45
46
47
48
# File 'lib/trailblazer/activity/circuit/task_adapter.rb', line 44

def call((ctx, _flow_options), **circuit_options)
  result = @step.(ctx, keyword_arguments: ctx.to_hash, **circuit_options) # circuit_options contains :exec_context.
  # in an immutable environment we should return the ctx from the step.
  return result, ctx
end