Method: Hanami::Slice::ClassMethods#key?

Defined in:
lib/hanami/slice.rb

#key?(key) ⇒ Boolean

Returns true if the component with the given key is registered in the container.

For a prepared slice, calling key? will also try to load the component if not loaded already.

Parameters:

  • key (String, Symbol)

    the component key

Returns:

  • (Boolean)

Since:

  • 2.0.0

Since:

  • 2.0.0



596
597
598
# File 'lib/hanami/slice.rb', line 596

def key?(...)
  container.key?(...)
end