Class: MasterDataTool::Config
- Inherits:
-
Object
- Object
- MasterDataTool::Config
- Includes:
- ActiveSupport::Configurable
- 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
Returns a new instance of Config.
10 11 12 13 |
# File 'lib/master_data_tool/config.rb', line 10 def initialize self.master_data_dir = nil self.spec_configs = [] end |
Instance Method Details
#csv_dir_for(spec_name:, override_identifier: nil) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/master_data_tool/config.rb', line 19 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
15 16 17 |
# File 'lib/master_data_tool/config.rb', line 15 def spec_config(spec_name) spec_configs.detect { |c| c.spec_name.to_s == spec_name.to_s } end |