Class: Klue::Langcraft::DSL::Webhook

Inherits:
Object
  • Object
show all
Defined in:
lib/klue/langcraft/dsl/webhook.rb

Overview

Webhook class for handling HTTP POST requests to specified URLs. This class is responsible for sending processed data to external services via webhooks, handling the delivery process, and logging the results.

Instance Method Summary collapse

Instance Method Details

#deliver(webhook_url, data) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/klue/langcraft/dsl/webhook.rb', line 14

def deliver(webhook_url, data)
  klue_type = extract_klue_type(data)
  uri = build_uri(webhook_url, klue_type)
  response = send_request(uri, build_payload(klue_type, data))
  log_response(response, uri)
  response
end