Sha256: bc62ec0830863df6ccad1e35c4f1906e5aeca2688f3c1ee9f3074cbef7025fb2

Contents?: true

Size: 791 Bytes

Versions: 1

Compression:

Stored size: 791 Bytes

Contents

# Dependencies can be defined on the operation. class level
class Trailblazer::V2_1::Operation
  module Skill
    # The class-level skill container: Operation::[], ::[]=.
    module Accessors
      # :private:
      def skills
        @skills ||= {}
      end

      extend Forwardable
      def_delegators :skills, :[], :[]=
    end
  end

  # The use of this module is not encouraged and it is only here for backward-compatibility.
  # Instead, please pass dependencies via containers, locals, or macros into the respective steps.
  module ClassDependencies
    def call_with_circuit_interface( (ctx, flow_options), **circuit_options )
      @skills.each { |name, value| ctx[name] ||= value } # this resembles the behavior in 2.0. we didn't say we liked it.

      super
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
trailblazer-future-2.1.0.rc1 lib/trailblazer/v2_1/operation/class_dependencies.rb