Module: PactBroker::Api::Resources::WebhookExecutionMethods

Included in:
Pact, PublishContracts, Verifications, WebhookExecution
Defined in:
lib/pact_broker/api/resources/webhook_execution_methods.rb

Instance Method Summary collapse

Instance Method Details

#finish_requestObject



19
20
21
22
23
24
# 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 = {}) ⇒ Object



8
9
10
11
12
13
# 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_webhooksObject



15
16
17
# File 'lib/pact_broker/api/resources/webhook_execution_methods.rb', line 15

def schedule_triggered_webhooks
  webhook_event_listener&.schedule_triggered_webhooks
end