lib/dependor/auto_inject.rb in dependor-0.0.1 vs lib/dependor/auto_inject.rb in dependor-0.0.2
- old
+ new
@@ -1,8 +1,7 @@
module Dependor
module AutoInject
-
module ClassMethods
def look_in_modules(*modules)
search_modules.concat(modules)
end
@@ -19,9 +18,15 @@
auto_injector.get(name)
end
def respond_to?(name)
auto_injector.resolvable?(name)
+ end
+
+ def inject(klass, overrides = {})
+ injector = Dependor::CustomizedInjector.new(auto_injector, overrides)
+ instantiator = Dependor::Instantiator.new(injector)
+ instantiator.instantiate(klass)
end
private
def auto_injector