Class: Rodakase::Config

Inherits:
Object
  • Object
show all
Extended by:
Dry::Configurable
Defined in:
lib/rodakase/config.rb

Class Method Summary collapse

Class Method Details

.load(root, env) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rodakase/config.rb', line 7

def self.load(root, env)
  path = root.join('config').join('application.yml')

  return unless File.exist?(path)

  yaml = YAML.load_file(path)

  yaml.fetch(env.to_s).each do |key, value|
    setting key.downcase.to_sym, ENV.fetch(key, value)
  end

  config
end