Sha256: f8f3797b3a975d8379deb3c9185e5eca7b3e9c3a3e69d93d455320ff4aff5e04

Contents?: true

Size: 783 Bytes

Versions: 28

Compression:

Stored size: 783 Bytes

Contents

require 'singleton'

require 'awspec/error'

module Awspec
  class Config
    include Singleton

    def initialize
      @config = {
        client_backoff: 0.0,
        client_backoff_limit: 30.0,
        client_iteration: 1
      }
    end

    def client_backoff(backoff)
      @config[:client_backoff] = backoff
    end

    def client_backoff_limit(backoff_limit)
      @config[:client_backoff_limit] = backoff_limit
    end

    def client_iteration(iteration)
      @config[:client_iteration] = iteration
    end

    def [](key)
      @config.fetch(key)
    end

    def method_missing(method_name, *_args)
      raise UnknownConfiguration, "'#{method_name}' is not a valid configuration for Awspec."
    end
  end

  def self.configure
    yield(Config.instance)
  end
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
awspec-1.25.1 lib/awspec/config.rb
awspec-1.25.0 lib/awspec/config.rb
awspec-1.24.4 lib/awspec/config.rb
awspec-1.24.3 lib/awspec/config.rb
awspec-1.24.2 lib/awspec/config.rb
awspec-1.24.1 lib/awspec/config.rb
awspec-1.24.0 lib/awspec/config.rb
awspec-1.23.0 lib/awspec/config.rb
awspec-1.22.1 lib/awspec/config.rb
awspec-1.22.0 lib/awspec/config.rb
awspec-1.21.1 lib/awspec/config.rb
awspec-1.21.0 lib/awspec/config.rb
awspec-1.20.0 lib/awspec/config.rb
awspec-1.19.2 lib/awspec/config.rb
awspec-1.19.1 lib/awspec/config.rb
awspec-1.19.0 lib/awspec/config.rb
cthiesfork-awspec-1.2.4 lib/awspec/config.rb
awspec-api_gateway_extended-1.2.4 lib/awspec/config.rb
awspec-api_gateway_extended-1.2.3 lib/awspec/config.rb
awspec-1.18.6 lib/awspec/config.rb