Module: DBConfig
- Included in:
- DataSet
- Defined in:
- lib/sqlloader/database.rb
Instance Method Summary collapse
- #get_config_path(dataset_path) ⇒ Object
-
#load_config(path) ⇒ Object
Generates a configuration hash from a JSON file.
Instance Method Details
#get_config_path(dataset_path) ⇒ Object
49 50 51 |
# File 'lib/sqlloader/database.rb', line 49 def get_config_path(dataset_path) File.join(dataset_path, 'config.json') end |
#load_config(path) ⇒ Object
Generates a configuration hash from a JSON file
[path] the path to the dataset to load a config for
43 44 45 46 47 |
# File 'lib/sqlloader/database.rb', line 43 def load_config(path) require 'json' config = JSON.parse(File.read(self.get_config_path(path)), :symbolize_names => true) end |