Module: Csv2Psql::Config

Defined in:
lib/csv2psql/config/config.rb

Overview

Configuration module

Constant Summary collapse

BASE_DIR =
File.join(File.dirname(__FILE__), '..', '..', '..')
CONFIG_PATH =
File.join(BASE_DIR, 'config', 'config.json')

Class Method Summary collapse

Class Method Details

.config(path = CONFIG_PATH) ⇒ Object



14
15
16
17
# File 'lib/csv2psql/config/config.rb', line 14

def config(path = CONFIG_PATH)
  @config ||= load_config(path)
  @config
end

.load_config(path = CONFIG_PATH) ⇒ Object



19
20
21
# File 'lib/csv2psql/config/config.rb', line 19

def load_config(path = CONFIG_PATH)
  JsonHelper.load_file(path)
end