Module: Pandur::Config
Constant Summary collapse
- @@config =
{}
Instance Method Summary collapse
Instance Method Details
#config(*params) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/pandur/config.rb', line 25 def config(*params) @@config ||= {} case params.length() when 0 @@config when 1 @@config[params.first] else @@config[params[0]] = params[1] end end |
#load_config(file) ⇒ Object
16 17 18 19 |
# File 'lib/pandur/config.rb', line 16 def load_config(file) logger.debug("Loading configuration from #{file.to_s}") @@config = YAML::load_file(File.(file)) end |
#logger ⇒ Object
21 22 23 |
# File 'lib/pandur/config.rb', line 21 def logger @@logger ||= Logger.new(STDERR) end |