Module: HatiConfig::Configuration::Local
- Defined in:
- lib/hati_config/configuration.rb
Overview
Isolated module provides methods for handling isolated configurations.
Instance Method Summary collapse
-
#configure(config_tree_name, opts = {}) { ... } ⇒ self
Configures an isolated config tree and tracks it.
-
#inherited(base) ⇒ Object
Inherits isolated configurations to the base class.
Instance Method Details
#configure(config_tree_name, opts = {}) { ... } ⇒ self
Configures an isolated config tree and tracks it
23 24 25 26 27 28 29 30 |
# File 'lib/hati_config/configuration.rb', line 23 def configure(config_tree_name, opts = {}, &block) super @isolated_configs ||= [] @isolated_configs << config_tree_name self end |
#inherited(base) ⇒ Object
Inherits isolated configurations to the base class
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/hati_config/configuration.rb', line 43 def inherited(base) super @isolated_configs.each do |parent_config| hash = __send__(parent_config).to_h schema = __send__(parent_config).type_schema lock_schema = __send__(parent_config).lock_schema base.configure parent_config, hash: hash, schema: schema, lock_schema: lock_schema end end |