Sha256: 2c9c973e5631f36f8e86afa20d8a8ba268302d938699f7454e3e54a73233d5ac

Contents?: true

Size: 727 Bytes

Versions: 28

Compression:

Stored size: 727 Bytes

Contents

require "pact_broker/string_refinements"

module PactBroker
  module Api
    module Contracts
      class Configuration
        using PactBroker::StringRefinements

        def initialize(overrides = {})
          @overrides = overrides
        end

        def class_for(name)
          if overrides[name].is_a?(String)
            Object.const_get(overrides[name])
          elsif overrides[name].is_a?(Class)
            overrides[name]
          else
            Object.const_get("PactBroker::Api::Contracts::#{name.to_s.camelcase(true)}")
          end
        end

        def self.default_configuration
          Configuration.new
        end

        private

        attr_reader :overrides
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
pact_broker-2.106.0 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.105.0 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.104.0 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.103.0 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.102.2 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.102.1 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.102.0 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.101.0 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.100.0 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.99.0 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.98.0 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.97.0 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.96.0 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.95.1 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.95.0 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.94.0 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.93.4 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.93.3 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.93.2 lib/pact_broker/api/contracts/configuration.rb
pact_broker-2.93.1 lib/pact_broker/api/contracts/configuration.rb