Sha256: 93ca95297025d796cb892232a99ea5ebe4b78ab86788fb6d3c07ddb6c7581e29

Contents?: true

Size: 821 Bytes

Versions: 9

Compression:

Stored size: 821 Bytes

Contents

module Jackhammer
  class Configuration
    attr_accessor(
      :app_name,
      :connection_options,
      :connection_url,
      :environment,
      :exception_adapter,
      :logger,
      :publish_options,
      :server,
      :yaml_config
    )

    def initialize
      @connection_options = {}
      @connection_url = ENV['RABBITMQ_URL']
      @environment = ENV['RACK_ENV'] || :development
      @exception_adapter = proc { |e| fail e }
      @logger = Logger.new IO::NULL
      @publish_options = { mandatory: true, persistent: true }
      @yaml_config = './config/jackhammer.yml'
    end

    def self.instance
      @instance ||= new
    end

    def yaml
      environment = Jackhammer.configuration.environment.to_s
      YAML.load_file(Jackhammer.configuration.yaml_config)[environment]
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
jackhammer-1.3.7 lib/jackhammer/configuration.rb
jackhammer-1.3.6 lib/jackhammer/configuration.rb
jackhammer-1.3.5 lib/jackhammer/configuration.rb
jackhammer-1.3.4 lib/jackhammer/configuration.rb
jackhammer-1.3.3 lib/jackhammer/configuration.rb
jackhammer-1.3.2 lib/jackhammer/configuration.rb
jackhammer-1.3.1 lib/jackhammer/configuration.rb
jackhammer-1.3.0 lib/jackhammer/configuration.rb
jackhammer-1.2.0 lib/jackhammer/configuration.rb