lib/invokr/dependency_injection.rb in invokr-0.9.1 vs lib/invokr/dependency_injection.rb in invokr-0.9.2

- old
+ new

@@ -38,10 +38,14 @@ end def fetch arg, &default resolver.resolve arg, &default end + + def has_key? arg + resolver.could_resolve? arg + end end class KlassInjector < Injector def inject _method = Invokr.query_method method @@ -75,9 +79,13 @@ ) end def resolve val, &block @hsh.fetch val, &block + end + + def could_resolve? val + @hsh.has_key? val end end end end