Class: PactBroker::Api::Decorators::WebhookExecutionResultDecorator::HTTPResponseDecorator

Inherits:
BaseDecorator
  • Object
show all
Defined in:
lib/pact_broker/api/decorators/webhook_execution_result_decorator.rb

Instance Method Summary collapse

Methods included from PactBrokerUrls

#hal_browser_url, #latest_pact_url, #latest_pacts_url, #latest_verifications_for_consumer_version_url, #latest_version_url, #new_verification_url, #pact_url, #pact_url_from_params, #pact_version_url, #pact_versions_url, #pacticipant_url, #pacticipants_url, #previous_distinct_diff_url, #previous_distinct_pact_version_url, #tag_url, #tags_url, #url_encode, #verification_publication_url, #verification_url, #version_url, #versions_url, #webhook_execution_url, #webhook_url, #webhooks_for_pact_url, #webhooks_url

Instance Method Details

#bodyObject



30
31
32
33
34
35
36
# File 'lib/pact_broker/api/decorators/webhook_execution_result_decorator.rb', line 30

def body
  begin
    ::JSON.parse(represented.body)
  rescue StandardError => e
    represented.body
  end
end

#headersObject



23
24
25
26
27
28
# File 'lib/pact_broker/api/decorators/webhook_execution_result_decorator.rb', line 23

def headers
  headers_hash = represented.to_hash
  headers_hash.keys.each_with_object({}) do | name, new_headers_hash|
    new_headers_hash[name] = headers_hash[name].join(", ")
  end
end