module PactBroker::Api::Resources::WebhookExecutionMethods

Public Instance Methods

finish_request() click to toggle source
Calls superclass method
# File lib/pact_broker/api/resources/webhook_execution_methods.rb, line 19
def finish_request
  if response.code < 400
    schedule_triggered_webhooks
  end
  super
end
handle_webhook_events(event_context = {}) { || ... } click to toggle source
# File lib/pact_broker/api/resources/webhook_execution_methods.rb, line 8
def handle_webhook_events(event_context = {})
  @webhook_event_listener = PactBroker::Webhooks::EventListener.new(webhook_options(event_context))
  PactBroker::Events.subscribe(webhook_event_listener) do
    yield
  end
end
schedule_triggered_webhooks() click to toggle source
# File lib/pact_broker/api/resources/webhook_execution_methods.rb, line 15
def schedule_triggered_webhooks
  webhook_event_listener&.schedule_triggered_webhooks
end

Private Instance Methods

webhook_event_listener() click to toggle source
# File lib/pact_broker/api/resources/webhook_execution_methods.rb, line 40
def webhook_event_listener
  @webhook_event_listener
end
webhook_execution_configuration() click to toggle source
# File lib/pact_broker/api/resources/webhook_execution_methods.rb, line 35
def webhook_execution_configuration
  application_context.webhook_execution_configuration_creator.call(self)
end
webhook_options(event_context = {}) click to toggle source
# File lib/pact_broker/api/resources/webhook_execution_methods.rb, line 27
def webhook_options(event_context = {})
  {
    database_connector: database_connector,
    webhook_execution_configuration: webhook_execution_configuration.with_webhook_context(event_context)
  }
end