Module: Unifig::Providers::EnvFile

Defined in:
lib/unifig/providers/env-file.rb

Class Method Summary collapse

Class Method Details

.nameObject



11
12
13
# File 'lib/unifig/providers/env-file.rb', line 11

def name
  :'env-file'
end

.retrieve(var_names, config) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/unifig/providers/env-file.rb', line 15

def retrieve(var_names, config)
  env_vars = Unifig::Env::Parser.call(config.fetch(:file, PATH))

  var_names.to_h do |name|
    [name, env_vars[name.to_s]]
  end
end