module Dry::Core::Container::Mixin

def merge(other, namespace: nil, &block)

Other tags:
    Api: - public

Returns:
  • (Dry::Core::Container::Mixin) - self

Parameters:
  • namespace (Symbol, nil) --
  • other (Dry::Core::Container) --
def merge(other, namespace: nil, &block)
  if namespace
    _container.merge!(
      other._container.each_with_object(::Concurrent::Hash.new) { |(key, item), hsh|
        hsh[PREFIX_NAMESPACE.call(namespace, key, config)] = item
      },
      &block
    )
  else
    _container.merge!(other._container, &block)
  end
  self
end