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



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

def [](field)
  class_fields[field]
end

#[]=(field, value) ⇒ Object

Store a field on @state, which is provided by Strategy.



12
13
14
15
16
# File 'lib/trailblazer/operation/class_dependencies.rb', line 12

def []=(field, value)
  @state.update!(:fields) do |fields|
    fields.merge(field => value)
  end
end

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



31
32
33
34
35
# File 'lib/trailblazer/operation/class_dependencies.rb', line 31

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



18
19
20
21
# File 'lib/trailblazer/operation/class_dependencies.rb', line 18

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