Class: PactBroker::Client::Pacticipants
- Inherits:
-
BaseClient
- Object
- BaseClient
- PactBroker::Client::Pacticipants
- Defined in:
- lib/pact_broker/client/pacticipants.rb
Constant Summary
Constants inherited from BaseClient
BaseClient::ERROR_CODE_MAPPING
Instance Attribute Summary
Attributes inherited from BaseClient
Instance Method Summary collapse
- #get1(options) ⇒ Object
- #list ⇒ Object
- #repository_url(options) ⇒ Object
- #update(options) ⇒ Object
- #versions ⇒ Object
Methods inherited from BaseClient
#default_get_headers, #default_patch_headers, #default_put_headers, #default_request_headers, #get, #handle_response, #initialize, #patch, #put, #url_for_relation, #verbose?
Methods included from StringToSymbol
Methods included from UrlHelpers
#encode_param, #encode_query_param
Constructor Details
This class inherits a constructor from PactBroker::Client::BaseClient
Instance Method Details
#get1(options) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/pact_broker/client/pacticipants.rb', line 25 def get1 response = get(pacticipant_base_url(), headers: default_get_headers) handle_response(response) do JSON.parse(response.body) end end |
#list ⇒ Object
32 33 34 35 36 37 |
# File 'lib/pact_broker/client/pacticipants.rb', line 32 def list response = get("/pacticipants", headers: default_get_headers) handle_response(response) do JSON.parse(response.body) end end |
#repository_url(options) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/pact_broker/client/pacticipants.rb', line 39 def repository_url response = get("#{pacticipant_base_url()}/repository_url", headers: default_get_headers.merge('Accept' => 'text/plain')) handle_response(response) do response.body end end |
#update(options) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/pact_broker/client/pacticipants.rb', line 17 def update body = .select{ | key, v | [:repository_url].include?(key)} response = patch(pacticipant_base_url(), body: body, headers: default_patch_headers) handle_response(response) do true end end |