Class: PactBroker::Client::PactBrokerClient

Inherits:
Object
  • Object
show all
Defined in:
lib/pact_broker/client/pact_broker_client.rb

Constant Summary collapse

DEFAULT_OPTIONS =
{base_url: DEFAULT_PACT_BROKER_BASE_URL}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ PactBrokerClient

Returns a new instance of PactBrokerClient.



17
18
19
20
21
# File 'lib/pact_broker/client/pact_broker_client.rb', line 17

def initialize options = {}
  merged_options = DEFAULT_OPTIONS.merge(options)
  @base_url = merged_options[:base_url]
  @client_options = merged_options[:client_options] || {}
end

Instance Attribute Details

#base_urlObject (readonly)

Returns the value of attribute base_url.



15
16
17
# File 'lib/pact_broker/client/pact_broker_client.rb', line 15

def base_url
  @base_url
end

#client_optionsObject (readonly)

Returns the value of attribute client_options.



15
16
17
# File 'lib/pact_broker/client/pact_broker_client.rb', line 15

def client_options
  @client_options
end

Instance Method Details

#matrixObject



31
32
33
# File 'lib/pact_broker/client/pact_broker_client.rb', line 31

def matrix
  PactBroker::Client::Matrix.new base_url: base_url, client_options: client_options
end

#pacticipantsObject



23
24
25
# File 'lib/pact_broker/client/pact_broker_client.rb', line 23

def pacticipants
  PactBroker::Client::Pacticipants.new base_url: base_url, client_options: client_options
end

#pactsObject



27
28
29
# File 'lib/pact_broker/client/pact_broker_client.rb', line 27

def pacts
  PactBroker::Client::Pacts.new base_url: base_url, client_options: client_options
end