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.



19
20
21
22
23
# File 'lib/pact_broker/client/pact_broker_client.rb', line 19

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.



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

def base_url
  @base_url
end

#client_optionsObject (readonly)

Returns the value of attribute client_options.



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

def client_options
  @client_options
end

Instance Method Details

#pacticipantsObject



25
26
27
# File 'lib/pact_broker/client/pact_broker_client.rb', line 25

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

#pactsObject



29
30
31
# File 'lib/pact_broker/client/pact_broker_client.rb', line 29

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