Class: Gorgon::Configuration::ConfigurationParser
- Inherits:
-
Object
- Object
- Gorgon::Configuration::ConfigurationParser
- Defined in:
- lib/gorgon/configuration.rb
Instance Method Summary collapse
-
#initialize(file_loader:) ⇒ ConfigurationParser
constructor
A new instance of ConfigurationParser.
- #load_from_files(first_filename:, merge_filename:) ⇒ Object
Constructor Details
#initialize(file_loader:) ⇒ ConfigurationParser
Returns a new instance of ConfigurationParser.
18 19 20 |
# File 'lib/gorgon/configuration.rb', line 18 def initialize(file_loader:) @file_loader = file_loader end |
Instance Method Details
#load_from_files(first_filename:, merge_filename:) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/gorgon/configuration.rb', line 22 def load_from_files(first_filename:, merge_filename:) if merge_filename && @file_loader.exists?(merge_filename) load_file(first_filename).deep_merge(load_file(merge_filename)) else load_file(first_filename) end end |