module RubyRabbitmqJanus::Tools::ConfigRabbit

Subclass for Config

Options about bunny

@see RubyRabbitmqJanus::Tools::Config

Public Instance Methods

admin_pass() click to toggle source

@return [String] read configuration fir queue admin

# File lib/rrj/tools/gem/config/rabbit.rb, line 14
def admin_pass
  @options['rabbit']['admin_pass'].to_s
rescue StandardError
  raise RubyRabbitmqJanus::Errors::Tools::AdminPassword
end
log_level_rabbit() click to toggle source

@return [Symbol] read configuration for bunny log level

# File lib/rrj/tools/gem/config/rabbit.rb, line 21
def log_level_rabbit
  @options['rabbit']['level'].upcase.to_sym || :INFO
end
server_settings() click to toggle source

@return [Hash] Format hash for bunny settings

# File lib/rrj/tools/gem/config/rabbit.rb, line 26
def server_settings
  Hash[%w[host port pass user vhost log_level].map do |value|
    key = value.to_sym
    j_value = @options['rabbit'][rabbitmq_conf(value)]

    raise Errors::Tools::Config::Rabbitmq value if j_value.blank?

    [key, j_value]
  end]
end

Private Instance Methods

rabbitmq_conf(value) click to toggle source
# File lib/rrj/tools/gem/config/rabbit.rb, line 39
def rabbitmq_conf(value)
  value.eql?('log_level') ? 'level' : value
end