Method: Hanami::Slice::ClassMethods#prepare_container

Defined in:
lib/hanami/slice.rb

#prepare_container {|container| ... } ⇒ self

Captures the given block to be called with the slice’s container during the slice’s prepare step, after the slice has already configured the container.

This is intended for advanced usage only and should not be needed for ordinary slice configuration and usage.

Examples:

module MySlice
  class Slice < Hanami::Slice
    prepare_container do |container|
      # ...
    end
  end
end

Yield Parameters:

  • container (Dry::System::Container)

    the slice’s container

Returns:

  • (self)

See Also:

Since:

  • 2.0.0



315
316
317
318
# File 'lib/hanami/slice.rb', line 315

def prepare_container(&block)
  @prepare_container_block = block
  self
end