Method: Hanami::Slice::ClassMethods#container

Defined in:
lib/hanami/slice.rb

#containerObject (readonly)

Returns the slice’s container.

This is a Dry::System::Container that is already configured for the slice.

In ordinary usage, you shouldn’t need direct access the container at all, since the slice provides its own methods for interacting with the container (such as #[], #keys, #key? #register, #register_provider, #prepare, #start, #stop).

If you need to configure the container directly, use #prepare_container.

See Also:

Since:

  • 2.0.0

API:

  • public



92
93
94
# File 'lib/hanami/slice.rb', line 92

def container
  @container
end