module Trailblazer::Operation::Trace

Public Class Methods

call(operation, options) click to toggle source

@note The problem in this method is, we have redundancy with Operation::PublicCall

# File lib/trailblazer/operation/trace.rb, line 8
def self.call(operation, options)
  # warn %{Trailblazer: `Operation.trace` is deprecated. Please use `Operation.wtf?`.} # DISCUSS: should this be deprecated?
  ctx = PublicCall.options_for_public_call(options) # redundant with PublicCall::call.

  stack, signal, (ctx, _flow_options) = Developer::Trace.(operation, [ctx, {}])

  result = Railway::Result(signal, ctx) # redundant with PublicCall::call.

  Result.new(result, stack.to_a)
end

Public Instance Methods

trace(options) click to toggle source

`Operation::trace` is included for simple tracing of the flow. It simply forwards all arguments to `Trace.call`.

@public

Operation.trace(params, current_user: current_user).wtf
# File lib/trailblazer/operation/trace.rb, line 25
def trace(options)
  Trace.(self, options)
end
wtf?(options) click to toggle source
# File lib/trailblazer/operation/trace.rb, line 29
def wtf?(options)
  call_with_public_interface(options, {}, invoke_class: Developer::Wtf)
end