Sha256: f741d136bcc3a2643a66136e3e8112c7e4f505b17e15d2c89046ca651f4c94d9

Contents?: true

Size: 473 Bytes

Versions: 20

Compression:

Stored size: 473 Bytes

Contents

# frozen_string_literal: true

module Totoro
  class Config
    def initialize(prefix = nil)
      @data = Rails.application.config_for(:totoro).with_indifferent_access
      @data = @data[prefix] if prefix.present?
    end

    def reset_data
      @data = nil
    end

    def connect
      @data[:connect]
    end

    def queue(id)
      name = @data[:queue][id][:name]
      settings = { durable: @data[:queue][id][:durable] }
      [name, settings]
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
totoro-0.6.1 lib/totoro/config.rb
totoro-0.6.0 lib/totoro/config.rb
totoro-0.5.7 lib/totoro/config.rb
totoro-0.5.3 lib/totoro/config.rb
totoro-0.5.2 lib/totoro/config.rb
totoro-0.5.1 lib/totoro/config.rb
totoro-0.5.0 lib/totoro/config.rb
totoro-0.4.1 lib/totoro/config.rb
totoro-0.4.0 lib/totoro/config.rb
totoro-0.2.9 lib/totoro/config.rb
totoro-0.2.8 lib/totoro/config.rb
totoro-0.2.7 lib/totoro/config.rb
totoro-0.2.6 lib/totoro/config.rb
totoro-0.2.5 lib/totoro/config.rb
totoro-0.2.4 lib/totoro/config.rb
totoro-0.2.3 lib/totoro/config.rb
totoro-0.2.2 lib/totoro/config.rb
totoro-0.2.1 lib/totoro/config.rb
totoro-0.2.0 lib/totoro/config.rb
totoro-0.1.6 lib/totoro/config.rb