Class: Hako::EnvProviders::File
- Inherits:
-
Hako::EnvProvider
- Object
- Hako::EnvProvider
- Hako::EnvProviders::File
- Defined in:
- lib/hako/env_providers/file.rb
Instance Method Summary collapse
- #ask(variables) ⇒ Object
-
#initialize(root_path, options) ⇒ File
constructor
A new instance of File.
Constructor Details
#initialize(root_path, options) ⇒ File
Returns a new instance of File.
7 8 9 10 11 12 |
# File 'lib/hako/env_providers/file.rb', line 7 def initialize(root_path, ) unless ['path'] validation_error!('path must be set') end @path = root_path.join(['path']) end |
Instance Method Details
#ask(variables) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/hako/env_providers/file.rb', line 14 def ask(variables) env = {} read_from_file do |key, val| if variables.include?(key) env[key] = val end end env end |