module Trailblazer::Activity::TaskBuilder

Public Class Methods

Binary(user_proc) click to toggle source

every step is wrapped by this proc/decider. this is executed in the circuit as the actual task. Step calls step.(options, **options, flow_options) Output signal binary: true=>Right, false=>Left. Passes through all subclasses of Direction.~~~~~~~~~~~~~~~~~

# File lib/trailblazer/activity/task_builder.rb, line 7
def self.Binary(user_proc)
  Task.new(Trailblazer::Option(user_proc), user_proc)
end
binary_signal_for(result, on_true, on_false) click to toggle source

Translates the return value of the user step into a valid signal. Note that it passes through subclasses of {Signal}.

# File lib/trailblazer/activity/task_builder.rb, line 13
def self.binary_signal_for(result, on_true, on_false)
  if result.is_a?(Class) && result < Activity::Signal
    result
  else
    result ? on_true : on_false
  end
end