Sha256: b16e63ffd2dcf2f945fdb4f5ad2b2c1bfe7f7142848766cab28f8e29e91b48f3

Contents?: true

Size: 589 Bytes

Versions: 1

Compression:

Stored size: 589 Bytes

Contents

module Dependor
  module AutoInject

    module ClassMethods
      def look_in_modules(*modules)
        search_modules.concat(modules)
      end

      def search_modules
        @search_modules ||= []
      end
    end

    def self.included(klass)
      klass.extend ClassMethods
    end

    def method_missing(name, *args, &block)
      auto_injector.get(name)
    end

    def respond_to?(name)
      auto_injector.resolvable?(name)
    end

    private

    def auto_injector
      @auto_injector ||= Dependor::AutoInjector.new(self, self.class.search_modules)
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dependor-0.0.1 lib/dependor/auto_inject.rb