lib/dry/container/mixin.rb in dry-container-0.2.8 vs lib/dry/container/mixin.rb in dry-container-0.3.0
- old
+ new
@@ -103,11 +103,11 @@
#
# @api public
def resolve(key)
config.resolver.call(_container, key)
end
- alias_method :[], :resolve
+ alias [] resolve
# Merge in the items of the other container
#
# @param [Dry::Container] other
# The other container to merge in
@@ -128,9 +128,18 @@
# @return [Bool]
#
# @api public
def key?(key)
config.resolver.key?(_container, key)
+ end
+
+ # An array of registered names for the container
+ #
+ # @return [Array<String>]
+ #
+ # @api public
+ def keys
+ config.resolver.keys(_container)
end
# Evaluate block and register items in namespace
#
# @param [Mixed] namespace