Class: BlueprintConfig::Backend::YAML
- Defined in:
- lib/blueprint_config/backend/yaml.rb
Instance Method Summary collapse
-
#initialize(path = 'config/app.yml') ⇒ YAML
constructor
A new instance of YAML.
- #load_keys ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(path = 'config/app.yml') ⇒ YAML
Returns a new instance of YAML.
10 11 12 |
# File 'lib/blueprint_config/backend/yaml.rb', line 10 def initialize(path = 'config/app.yml') @path = path end |
Instance Method Details
#load_keys ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/blueprint_config/backend/yaml.rb', line 14 def load_keys if File.exist?(path) parsed = ::YAML.load(File.read(path), aliases: true).deep_symbolize_keys parsed.fetch(:default, {}).deep_merge(parsed.fetch(BlueprintConfig.env&.to_sym, {})) else {} end end |