Module: Trailblazer::Operation::ClassDependencies

Defined in:
lib/trailblazer/operation/class_dependencies.rb

Overview

The use of this module is currently not encouraged and it is only here for backward-compatibility. Instead, please pass dependencies via containers, locals, or macros into the respective steps.

Instance Method Summary collapse

Instance Method Details

#[](field) ⇒ Object



6
7
8
# File 'lib/trailblazer/operation/class_dependencies.rb', line 6

def [](field)
  @state.to_h[:fields][field]
end

#[]=(field, value) ⇒ Object



10
11
12
13
# File 'lib/trailblazer/operation/class_dependencies.rb', line 10

def []=(field, value)
  options = @state.to_h[:fields].merge(field => value)
  @state.update_options(options)
end

#call_with_circuit_interface(ctx, flow_options, **circuit_options) ⇒ Object



28
29
30
31
32
# File 'lib/trailblazer/operation/class_dependencies.rb', line 28

def call_with_circuit_interface((ctx, flow_options), **circuit_options)
  ctx_with_fields = context_for_fields(class_fields, [ctx, flow_options], **circuit_options)

  super([ctx_with_fields, flow_options], **circuit_options) # FIXME: should we unwrap here?
end

#options_for_public_call(options, flow_options) ⇒ Object



15
16
17
18
# File 'lib/trailblazer/operation/class_dependencies.rb', line 15

def options_for_public_call(options, flow_options)
  ctx = super
  context_for_fields(class_fields, [ctx, flow_options])
end