Sha256: d60353f97120fb787a108a54daee284c63ac91163f0ffe00c90f670e2b3999f6

Contents?: true

Size: 648 Bytes

Versions: 1

Compression:

Stored size: 648 Bytes

Contents

require 'active_support/configurable'

module MasterDataTool
  class Config
    include ActiveSupport::Configurable

    config_accessor :master_data_dir
    config_accessor :spec_configs

    def initialize
      self.master_data_dir = nil
      self.spec_configs = []
    end

    def spec_config(spec_name)
      spec_configs.detect { |c| c.spec_name == spec_name }
    end

    def csv_dir_for(spec_name, override_identifier = nil)
      path = MasterDataTool.config.master_data_dir
      path = path.join(spec_name) if spec_name.present?
      path = path.join(override_identifier) if override_identifier.present?
      path
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
master_data_tool-0.20.0 lib/master_data_tool/config.rb