Sha256: 7cdaa1adae0d1299845f178dc43cf40b3510db7d3aef18c453133c9d48a887e3
Contents?: true
Size: 810 Bytes
Versions: 6
Compression:
Stored size: 810 Bytes
Contents
# frozen_string_literal: true require 'dry/auto_inject/strategies' module Dry module AutoInject class Injector < BasicObject # @api private attr_reader :container # @api private attr_reader :strategy # @api private attr_reader :builder # @api private def initialize(container, strategy, builder:) @container = container @strategy = strategy @builder = builder end def [](*dependency_names) strategy.new(container, *dependency_names) end def respond_to?(name, include_private = false) Injector.instance_methods.include?(name) || builder.respond_to?(name) end private def method_missing(name, *args, &block) builder.__send__(name) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems