Class: AppConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/app_config.rb

Direct Known Subclasses

Secrets

Defined Under Namespace

Classes: ParsingError

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename = "") ⇒ AppConfig

Returns a new instance of AppConfig.



22
23
24
# File 'lib/app_config.rb', line 22

def initialize(filename = "")
	@filename = filename.empty? ? default_filename : filename
end

Class Method Details

.loadObject



7
8
9
# File 'lib/app_config.rb', line 7

def load
	new(app_config_path).load
end

Instance Method Details

#loadObject



26
27
28
29
30
# File 'lib/app_config.rb', line 26

def load
	config['environment']&.each do |key, value|
		ENV[key] = value.is_a?(Hash) || value.is_a?(Array) ? value.to_json : value.to_s
	end
end