Module: Sbmt::Pact::Consumer::PactConfig

Defined in:
lib/sbmt/pact/consumer/pact_config.rb,
lib/sbmt/pact/consumer/pact_config/base.rb,
lib/sbmt/pact/consumer/pact_config/grpc.rb,
lib/sbmt/pact/consumer/pact_config/http.rb,
lib/sbmt/pact/consumer/pact_config/message.rb

Defined Under Namespace

Classes: Base, Grpc, Http, Message

Class Method Summary collapse

Class Method Details

.new(transport_type, consumer_name:, provider_name:, opts: {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/sbmt/pact/consumer/pact_config.rb', line 9

def self.new(transport_type, consumer_name:, provider_name:, opts: {})
  case transport_type
  when :http
    Http.new(consumer_name: consumer_name, provider_name: provider_name, opts: opts)
  when :grpc
    Grpc.new(consumer_name: consumer_name, provider_name: provider_name, opts: opts)
  when :message
    Message.new(consumer_name: consumer_name, provider_name: provider_name, opts: opts)
  else
    raise ArgumentError, "unknown transport_type: #{transport_type}"
  end
end