Sha256: 0e1b909ff31b598b6e59113a4dac01f87b8e5061c140c73d08dee0835e3c6322

Contents?: true

Size: 1.59 KB

Versions: 7

Compression:

Stored size: 1.59 KB

Contents

# frozen_string_literal: true

module Dry
  module System
    module Plugins
      module DependencyGraph
        # @api private
        class Strategies
          extend Core::Container::Mixin

          # @api private
          class Kwargs < Dry::AutoInject::Strategies::Kwargs
            private

            # @api private
            def define_initialize(klass)
              @container["notifications"].instrument(
                :resolved_dependency,
                dependency_map: dependency_map.to_h,
                target_class: klass
              )

              super(klass)
            end
          end

          # @api private
          class Args < Dry::AutoInject::Strategies::Args
            private

            # @api private
            def define_initialize(klass)
              @container["notifications"].instrument(
                :resolved_dependency,
                dependency_map: dependency_map.to_h,
                target_class: klass
              )

              super(klass)
            end
          end

          class Hash < Dry::AutoInject::Strategies::Hash
            private

            # @api private
            def define_initialize(klass)
              @container["notifications"].instrument(
                :resolved_dependency,
                dependency_map: dependency_map.to_h,
                target_class: klass
              )

              super(klass)
            end
          end

          register :kwargs, Kwargs
          register :args, Args
          register :hash, Hash
          register :default, Kwargs
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dry-system-1.1.1 lib/dry/system/plugins/dependency_graph/strategies.rb
dry-system-1.1.0 lib/dry/system/plugins/dependency_graph/strategies.rb
dry-system-1.1.0.beta2 lib/dry/system/plugins/dependency_graph/strategies.rb
dry-system-1.1.0.beta1 lib/dry/system/plugins/dependency_graph/strategies.rb
dry-system-1.0.1 lib/dry/system/plugins/dependency_graph/strategies.rb
dry-system-1.0.0 lib/dry/system/plugins/dependency_graph/strategies.rb
dry-system-1.0.0.rc1 lib/dry/system/plugins/dependency_graph/strategies.rb