Class: Continuance::Core::YamlConfiguration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/continuance/core/yaml_configuration.rb

Overview

The configuration class abstracts access to the underlying YAML file

Instance Method Summary collapse

Instance Method Details

#load(configuration_key) ⇒ Object

If the configuration loader fails for any reason then just return an empty hash



12
13
14
15
16
17
# File 'lib/continuance/core/yaml_configuration.rb', line 12

def load(configuration_key)
  config_file_path = File.join(Rails.root, "config/#{configuration_key}.yml")
  YAML.load_file(config_file_path)[Rails.env]
  rescue
    {}
end