Sha256: 2b7a094f5dcaf187f945e8599fc4fa44d7af8a0ba25c904f49525dfa2ea4c8f3

Contents?: true

Size: 584 Bytes

Versions: 3

Compression:

Stored size: 584 Bytes

Contents

module Materialist
  class << self
    def configuration
      @configuration ||= Configuration.new
    end

    def reset_configuration!
      @configuration = Configuration.new
    end

    def configure
      yield(self.configuration)
    end
  end

  class Configuration
    attr_accessor :topics, :sidekiq_options, :metrics_client

    def initialize
      @topics = []
      @sidekiq_options = {}
      @metrics_client = NullMetricsClient
    end

    class NullMetricsClient
      def self.increment(_, tags:); end
      def self.histogram(_, _v, tags:); end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
materialist-3.2.0 lib/configuration.rb
materialist-3.1.0 lib/configuration.rb
materialist-3.0.0 lib/configuration.rb