class Dry::Core::Container::Registry

def call(container, key, item, options)

Other tags:
    Api: - public

Returns:
  • (Mixed) -

Raises:
  • (Dry::Core::Container::KeyError) -

Options Hash: (**options)
  • :call (Symbol) --

Parameters:
  • options (Hash) --
  • item (Mixed) --
  • key (Mixed) --
  • container (Concurrent::Hash) --
def call(container, key, item, options)
  key = key.to_s.dup.freeze
  @_mutex.synchronize do
    if container.key?(key)
      raise KeyError, "There is already an item registered with the key #{key.inspect}"
    end
    container[key] = factory.call(item, options)
  end
end