Class: ParamStore::Adapters::Env
- Inherits:
-
Object
- Object
- ParamStore::Adapters::Env
- Defined in:
- lib/param_store/adapters/env.rb
Instance Method Summary collapse
- #fetch(key, *args, **_opts, &block) ⇒ Object
- #fetch_all(*keys, **_opts) ⇒ Object
-
#initialize(**_opts) ⇒ Env
constructor
A new instance of Env.
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 |