Class: MasterDataTool::Config
- Inherits:
-
Object
- Object
- MasterDataTool::Config
- Defined in:
- lib/master_data_tool/config.rb
Instance Method Summary collapse
- #csv_dir_for(spec_name:, override_identifier: nil) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #spec_config(spec_name) ⇒ Object
Constructor Details
#initialize ⇒ Config
6 7 8 9 |
# File 'lib/master_data_tool/config.rb', line 6 def initialize self.master_data_dir = nil self.spec_configs = [] end |
Instance Method Details
#csv_dir_for(spec_name:, override_identifier: nil) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/master_data_tool/config.rb', line 15 def csv_dir_for(spec_name:, override_identifier: nil) path = MasterDataTool.config.master_data_dir path = path.join(spec_name.to_s) if spec_name.present? path = path.join(override_identifier.to_s) if override_identifier.present? path end |
#spec_config(spec_name) ⇒ Object
11 12 13 |
# File 'lib/master_data_tool/config.rb', line 11 def spec_config(spec_name) spec_configs.detect { |c| c.spec_name.to_s == spec_name.to_s } end |