Module: Omnes::Configurable
- Included in:
- Omnes, Event, Subscriber, Subscriber::Adapter, Subscriber::Adapter::ActiveJob, Subscriber::Adapter::Sidekiq
- Defined in:
- lib/omnes/configurable.rb
Overview
Defined Under Namespace
Classes: Config
Class Method Summary collapse
- .extended(klass) ⇒ Object private
Instance Method Summary collapse
-
#config ⇒ Configurable::Config
Returns the configuration class.
-
#configure {|@config| ... } ⇒ Object
Yields the configuration class.
- #nest_config(constant, name: default_nesting_name(constant)) ⇒ Object private
- #setting(name, default:) ⇒ Object private
Class Method Details
Instance Method Details
#config ⇒ Configurable::Config
Returns the configuration class
Use this class to access readers and writers for the defined settings or nested configurations
77 78 79 |
# File 'lib/omnes/configurable.rb', line 77 def config @config end |
#configure {|@config| ... } ⇒ Object
Yields the configuration class
84 85 86 |
# File 'lib/omnes/configurable.rb', line 84 def configure yield @config end |
#nest_config(constant, name: default_nesting_name(constant)) ⇒ Object
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.
94 95 96 |
# File 'lib/omnes/configurable.rb', line 94 def nest_config(constant, name: default_nesting_name(constant)) config.add_nesting(constant, name) end |
#setting(name, default:) ⇒ Object
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.
89 90 91 |
# File 'lib/omnes/configurable.rb', line 89 def setting(name, default:) config.add_setting(name, default) end |