Module: Assent::Config
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.add(option, value) ⇒ Object
28 29 30 |
# File 'lib/assent/config/config.rb', line 28 def self.add(option, value) config[option] = value end |
.config ⇒ Object
32 33 34 |
# File 'lib/assent/config/config.rb', line 32 def self.config @@config ||= Hash.new end |
.config_file(path) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/assent/config/config.rb', line 17 def self.config_file(path) begin lang = YAML.load_file(path) lang.each do |key, value| add(key, value) end rescue Errno::ENOENT raise ConfigException.new "Config file could not be found." end end |