lib/invokr/dependency_injection.rb in invokr-0.0.4 vs lib/invokr/dependency_injection.rb in invokr-0.0.5
- old
+ new
@@ -7,12 +7,11 @@
injector.inject
end
Injector = Struct.new :resolver, :klass do
def inject
- invocation = Builder.build initializer, self, nil
- invocation.method = :new
- invocation.invoke! klass
+ method = Invokr.query_method klass.instance_method :initialize
+ method.invoke method: :new, with: self
end
def keys
initializer.parameters.map { |_, identifier| identifier }
end