Module: Trailblazer::Operation::DeprecatedMacro
- Defined in:
- lib/trailblazer/operation/deprecated_macro.rb
Class Method Summary collapse
-
.call(proc, options) ⇒ Object
Allows old macros with the ‘(input, options)` signature.
Class Method Details
.call(proc, options) ⇒ Object
Allows old macros with the ‘(input, options)` signature.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/trailblazer/operation/deprecated_macro.rb', line 5 def self.call(proc, ) warn %{[Trailblazer] Macros with API (input, options) are deprecated. Please use the "Task API" signature (options, flow_options) or use a simpler Callable. (#{proc})} wrapped_proc = ->((, ), **) do result = proc.([:exec_context], ) # run the macro, with the deprecated signature. direction = Activity::TaskBuilder.binary_signal_for(result, Activity::Right, Activity::Left) return direction, [, ] end .merge(task: wrapped_proc) end |