Method: Hanami::Slice::ClassMethods#config

Defined in:
lib/hanami/slice.rb

#configHanami::Config

Returns the slice’s config.

A slice’s config is copied from the app config at time of first access.

Returns:

See Also:

  • App::ClassMethods.config

Since:

  • 2.0.0

API:

  • public



124
125
126
127
128
129
# File 'lib/hanami/slice.rb', line 124

def config
  @config ||= app.config.dup.tap do |slice_config|
    # Unset config from app that does not apply to ordinary slices
    slice_config.root = nil
  end
end