Class: Trailblazer::Operation

Inherits:
Object
  • Object
show all
Extended by:
PublicCall, Trace
Defined in:
lib/trailblazer/operation.rb,
lib/trailblazer/operation/trace.rb,
lib/trailblazer/operation/result.rb,
lib/trailblazer/operation/railway.rb,
lib/trailblazer/operation/callable.rb,
lib/trailblazer/operation/class_dependencies.rb

Overview

Dependencies can be defined on the operation. class level

Defined Under Namespace

Modules: ClassDependencies, DeprecatedMacro, PublicCall, Railway, Trace Classes: Callable, Result

Class Method Summary collapse

Methods included from PublicCall

call, call_task, call_with_circuit_interface, call_with_flow_options, call_with_public_interface, flow_options_for_public_call, initial_wrap_static, options_for_public_call, options_for_public_call

Methods included from Trace

call, trace, wtf?

Class Method Details

.Callable(*args) ⇒ Object

Use Callable if you have an operation or any other callable object that does not expose an interface. For example, Trailblazer::Operation::PublicCall#call isn’t compatible with activities, hence you need to decorate it using Callable. The returned object exposes an interface.

Examples:

Create and use a Callable instance.

callable = Trailblazer::Operation::Callable( Memo::Create, call: :__call__ )
callable.( [ctx, {}] ) #=> Activity interface, ::call will invoke Memo::Create.__call__.

Parameters:

  • :call (Symbol)

    Method name to call

  • options (Hash)

    Hash to merge into circuit_options, e.g. :start_task.



14
15
16
# File 'lib/trailblazer/operation/callable.rb', line 14

def self.Callable(*args)
  Callable.new(*args)
end