class RabbitHutchWeb::RabbitSettings

Attributes

application[RW]
consumers[RW]
rabbitmq_hosts[RW]
settings[RW]

Public Class Methods

new() click to toggle source
# File web/rabbithutchweb.rb, line 10
def initialize
  file = File.dirname(__FILE__) + '/../config.yaml'
  @settings = YAML::load(File.open(file))
  @application = settings['application']
  @rabbitmq_hosts = settings['rabbitmq']['hosts']
  @consumers = settings['consumers_config']['consumers']
end

Public Instance Methods

parse(data) click to toggle source
# File web/rabbithutchweb.rb, line 25
def parse(data)
  @settings = YAML::load(data)
  @application = settings['application']
  @rabbitmq_hosts = settings['rabbitmq']['hosts']
  @consumers = settings['consumers_config']['consumers']
end
save() click to toggle source
# File web/rabbithutchweb.rb, line 18
def save
  file = File.dirname(__FILE__) + '/../config.yaml'
  File.open(file, "w") do|f|
    f.write self.settings.to_yaml
  end
end