Sha256: 583dcfc981d5aec8e6cf19666ccbc392e76d8f0f6faa9558157524cf7b1cb7f5

Contents?: true

Size: 481 Bytes

Versions: 2

Compression:

Stored size: 481 Bytes

Contents

module Dependor
  module Isolate
    def isolate(klass = nil, overrides = {}, &block)
      if block_given?
        klass = block.call
        caller_binding = block.binding
        injector = EvaluatingInjector.new(caller_binding)
      else
        sending_injector = SendingInjector.new(self)
        injector = CustomizedInjector.new(sending_injector, overrides)
      end
      instantiator = Instantiator.new(injector)
      instantiator.instantiate(klass)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dependor-1.0.0 lib/dependor/isolate.rb
dependor-0.0.6 lib/dependor/isolate.rb