Class: RabbitHutch::Configurator
- Inherits:
-
Object
- Object
- RabbitHutch::Configurator
- Defined in:
- lib/configurator.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
- #application ⇒ Object
- #consumers ⇒ Object
-
#initialize(options) ⇒ Configurator
constructor
A new instance of Configurator.
- #log_config ⇒ Object
- #rabbitmq_hosts ⇒ Object
Constructor Details
#initialize(options) ⇒ Configurator
Returns a new instance of Configurator.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/configurator.rb', line 8 def initialize file = ['config'] || (File.dirname(__FILE__) + '/../config.yaml') puts "Using config from #{file}" unless File.exists? file raise "Configuration file [#{file}] doesn't exist" end @config = YAML::load(File.open(file)) end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
6 7 8 |
# File 'lib/configurator.rb', line 6 def config @config end |
Instance Method Details
#application ⇒ Object
20 21 22 |
# File 'lib/configurator.rb', line 20 def application @config['application'] end |
#consumers ⇒ Object
28 29 30 |
# File 'lib/configurator.rb', line 28 def consumers @config['consumers_config']["consumers"] end |
#log_config ⇒ Object
24 25 26 |
# File 'lib/configurator.rb', line 24 def log_config @config['log4r_config'] end |
#rabbitmq_hosts ⇒ Object
32 33 34 |
# File 'lib/configurator.rb', line 32 def rabbitmq_hosts @config['rabbitmq']['hosts'] end |