Class: Soryo::Config
- Inherits:
-
Hash
- Object
- Hash
- Soryo::Config
- Defined in:
- lib/classes/config.rb
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #merge_with(config) ⇒ Object
-
#read_yaml(settings) ⇒ Object
Takes in settings file path, merges yaml with settings.
Constructor Details
Instance Method Details
#merge_with(config) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/classes/config.rb', line 30 def merge_with(config) new_self = self.merge(config) new_self.each do |k,v| self[k] = v end end |
#read_yaml(settings) ⇒ Object
Takes in settings file path, merges yaml with settings
38 39 40 41 42 43 44 45 |
# File 'lib/classes/config.rb', line 38 def read_yaml(settings) settings_instance = Soryo::FileInstance.new(settings) if settings_instance.existance? self.merge_with(settings_instance.to_hash) else raise 'NoFileFound' end end |