module ConfigReader::FileLoading
Public Instance Methods
load_config(config)
click to toggle source
# File lib/configreader/mixins/file_loading.rb, line 4 def load_config(config) config.is_a?(String) ? read_file(config) : config end
Private Instance Methods
config_path()
click to toggle source
# File lib/configreader/mixins/file_loading.rb, line 10 def config_path File.join(Rails.root, "config") end
full_path(file_name)
click to toggle source
# File lib/configreader/mixins/file_loading.rb, line 14 def full_path(file_name) File.join(config_path, file_name) end
read_file(file_name)
click to toggle source
# File lib/configreader/mixins/file_loading.rb, line 18 def read_file(file_name) YAML.load_file(full_path(file_name)) end