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
- #finish_request ⇒ Object
- #handle_webhook_events ⇒ Object
- #schedule_triggered_webhooks ⇒ Object
- #webhook_event_listener ⇒ Object
- #webhook_execution_configuration ⇒ Object
- #webhook_options ⇒ Object
Instance Method Details
#finish_request ⇒ Object
33 34 35 36 37 38 |
# File 'lib/pact_broker/api/resources/webhook_execution_methods.rb', line 33 def finish_request if response.code < 400 schedule_triggered_webhooks end super end |
#handle_webhook_events ⇒ Object
23 24 25 26 27 |
# File 'lib/pact_broker/api/resources/webhook_execution_methods.rb', line 23 def handle_webhook_events PactBroker::Events.subscribe(webhook_event_listener) do yield end end |
#schedule_triggered_webhooks ⇒ Object
29 30 31 |
# File 'lib/pact_broker/api/resources/webhook_execution_methods.rb', line 29 def schedule_triggered_webhooks webhook_event_listener.schedule_triggered_webhooks end |
#webhook_event_listener ⇒ Object
19 20 21 |
# File 'lib/pact_broker/api/resources/webhook_execution_methods.rb', line 19 def webhook_event_listener @webhook_event_listener ||= PactBroker::Webhooks::EventListener.new() end |
#webhook_execution_configuration ⇒ Object
8 9 10 |
# File 'lib/pact_broker/api/resources/webhook_execution_methods.rb', line 8 def webhook_execution_configuration application_context.webhook_execution_configuration_creator.call(self) end |
#webhook_options ⇒ Object
12 13 14 15 16 17 |
# File 'lib/pact_broker/api/resources/webhook_execution_methods.rb', line 12 def { database_connector: database_connector, webhook_execution_configuration: webhook_execution_configuration } end |