module Trailblazer::Activity::DSL::Linear::VariableMapping

Public Instance Methods

default_input() click to toggle source

@private

# File lib/trailblazer/activity/dsl/linear/variable_mapping.rb, line 37
def default_input
  ->(ctx, **) { ctx }
end
default_output() click to toggle source

@private

# File lib/trailblazer/activity/dsl/linear/variable_mapping.rb, line 29
def default_output
  ->(scoped, **) do
    _wrapped, mutable = scoped.decompose # `_wrapped` is what the `:input` filter returned, `mutable` is what the task wrote to `scoped`.
    mutable
  end
end
filter_for(filter) click to toggle source

Returns a filter proc to be called in an Option. @private

# File lib/trailblazer/activity/dsl/linear/variable_mapping.rb, line 43
def filter_for(filter)
  if filter.is_a?(::Array) || filter.is_a?(::Hash)
    DSL.filter_from_dsl(filter)
  else
    filter
  end
end
output_option_for(option, pass_outer_ctx) click to toggle source

@private

# File lib/trailblazer/activity/dsl/linear/variable_mapping.rb, line 52
def output_option_for(option, pass_outer_ctx) # DISCUSS: not sure I like this.

  return option if pass_outer_ctx
  # OutputReceivingInnerCtxOnly =

   # don't pass {outer_ctx}, only {inner_ctx}. this is the default.
  return ->(inner_ctx, outer_ctx, **kws) { option.(inner_ctx, **kws) }
end