module Trailblazer::Operation::ClassDependencies

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.

Public Instance Methods

[](field) click to toggle source
# File lib/trailblazer/operation/class_dependencies.rb, line 6
def [](field)
  @state.to_h[:fields][field]
end
[]=(field, value) click to toggle source
# 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) click to toggle source
Calls superclass method
# 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) click to toggle source
Calls superclass method
# 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

Private Instance Methods

class_fields() click to toggle source
# File lib/trailblazer/operation/class_dependencies.rb, line 20
        def class_fields
  @state.to_h[:fields]
end
context_for_fields(fields, (ctx, flow_options), **) click to toggle source
# File lib/trailblazer/operation/class_dependencies.rb, line 24
        def context_for_fields(fields, (ctx, flow_options), **)
  ctx_with_fields = Trailblazer::Context(fields, ctx, flow_options[:context_options]) # TODO: redundant to otions_for_public_call.
end