Module: Runger::DynamicConfig::ClassMethods
- Defined in:
- lib/runger/dynamic_config.rb
Instance Method Summary collapse
-
#for(name, auto_cast: true, **options) ⇒ Object
Load config as Hash by any name.
Instance Method Details
#for(name, auto_cast: true, **options) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/runger/dynamic_config.rb', line 14 def for(name, auto_cast: true, **) config = allocate [:env_prefix] ||= name.to_s.upcase [:config_path] ||= config.resolve_config_path(name, [:env_prefix]) raw_config = config.load_from_sources(new_empty_config, name:, **) return raw_config unless auto_cast ::Runger::AutoCast.call(raw_config) end |