Method: Trailblazer::Macro::Each.compute_runtime_id

Defined in:
lib/trailblazer/macro/each.rb

.compute_runtime_id(ctx, captured_node:, activity:, compile_id:) ⇒ Object

Gets included in Debugger’s Normalizer. Results in IDs like invoke_block_activityinvoke_block_activity.1.



69
70
71
72
73
74
75
76
# File 'lib/trailblazer/macro/each.rb', line 69

def self.compute_runtime_id(ctx, captured_node:, activity:, compile_id:, **)
  # activity is the host activity
  return compile_id unless activity[:each] == true

  index = captured_node.captured_input.data[:ctx_snapshot].fetch(:index)

  ctx[:runtime_id] = "#{compile_id}.#{index}"
end