Method: Hanami::Settings.load_for_slice

Defined in:
lib/hanami/settings.rb

.load_for_slice(slice) ⇒ Settings?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Loads the settings for a slice.

Returns nil if no settings class is defined.

Since:

  • 2.0.0



109
110
111
112
113
114
115
# File 'lib/hanami/settings.rb', line 109

def load_for_slice(slice)
  return unless settings_defined?(slice)

  require_slice_settings(slice) unless slice_settings_class?(slice)

  slice_settings_class(slice).new(slice.config.settings_store)
end