Module: Trailblazer::Operation::Trace

Included in:
Trailblazer::Operation
Defined in:
lib/trailblazer/operation/trace.rb

Defined Under Namespace

Classes: Result

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(operation, options) ⇒ Object

Note:

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



8
9
10
11
12
13
14
15
16
17
# 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

Instance Method Details

#trace(options) ⇒ Object

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



25
26
27
# File 'lib/trailblazer/operation/trace.rb', line 25

def trace(options)
  Trace.(self, options)
end

#wtf?(options) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/trailblazer/operation/trace.rb', line 29

def wtf?(options)
  call_with_public_interface(options, {}, invoke_class: Developer::Wtf)
end