Class: Herder::Config
- Inherits:
-
Object
- Object
- Herder::Config
- Defined in:
- lib/herder/config.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
6 7 8 9 10 11 12 13 |
# File 'lib/herder/config.rb', line 6 def initialize self. = YAML.load_file("config/herder.yml") rescue self. = {} ["site"] = ENV["HERDER_SITE"] || "http://localhost" ["user"] = ENV["HERDER_USER"] || "user" ["password"] = ENV["HERDER_PASSWORD"] || "password" end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/herder/config.rb', line 4 def end |
Class Method Details
.get(key) ⇒ Object
15 16 17 |
# File 'lib/herder/config.rb', line 15 def self.get key self.instance.[key] end |
.instance ⇒ Object
19 20 21 |
# File 'lib/herder/config.rb', line 19 def self.instance @instance ||= Herder::Config.new end |