Module: DevSuite::Utils::Construct::Config::Settings::Manager::ClassMethods

Defined in:
lib/dev_suite/utils/construct/config/settings/manager.rb

Instance Method Summary collapse

Instance Method Details

#inherited(subclass) ⇒ Object

Ensure that default configuration attributes are applied to subclasses.



17
18
19
20
# File 'lib/dev_suite/utils/construct/config/settings/manager.rb', line 17

def inherited(subclass)
  subclass.set_default_settings
  super
end

#set_default_settings(settings = {}) ⇒ Object

Define default settings for the class.



23
24
25
# File 'lib/dev_suite/utils/construct/config/settings/manager.rb', line 23

def set_default_settings(settings = {})
  config_attr(:settings, default_value: settings, type: :hash, resolver: :resolve_settings)
end