Class: ParamStore::Adapters::Env

Inherits:
Object
  • Object
show all
Defined in:
lib/param_store/adapters/env.rb

Instance Method Summary collapse

Constructor Details

#initialize(**_opts) ⇒ Env

Returns a new instance of Env.



4
# File 'lib/param_store/adapters/env.rb', line 4

def initialize(**_opts); end

Instance Method Details

#fetch(key, *args, **_opts, &block) ⇒ Object



6
7
8
# File 'lib/param_store/adapters/env.rb', line 6

def fetch(key, *args, **_opts, &block)
  ENV.fetch(key, *args, &block)
end

#fetch_all(*keys, **_opts) ⇒ Object



10
11
12
13
14
15
# File 'lib/param_store/adapters/env.rb', line 10

def fetch_all(*keys, **_opts)
  keys = keys.flatten
  keys.each_with_object({}) do |key, result|
    result[key] = ENV[key]
  end
end