Class: Mammoth::Destinations::WebhookAdapter

Inherits:
Adapter
  • Object
show all
Defined in:
lib/mammoth/destinations/webhook_adapter.rb

Overview

Built-in webhook destination adapter.

Class Method Summary collapse

Class Method Details

.adapter_typeString

Returns adapter type name.

Returns:

  • (String)

    adapter type name



9
10
11
# File 'lib/mammoth/destinations/webhook_adapter.rb', line 9

def adapter_type
  "webhook"
end

.build(destination, label:) ⇒ Mammoth::WebhookSink

Build a webhook sink from destination configuration.

Parameters:

  • destination (Hash)

    destination configuration

  • label (String)

    config path label for errors

Returns:



18
19
20
# File 'lib/mammoth/destinations/webhook_adapter.rb', line 18

def build(destination, label:)
  WebhookSink.from_destination_config(destination, label: label)
end

.capabilitiesHash

Returns JSON-friendly capabilities.

Returns:

  • (Hash)

    JSON-friendly capabilities



23
24
25
# File 'lib/mammoth/destinations/webhook_adapter.rb', line 23

def capabilities
  { type: adapter_type, delivery_units: %w[event transaction], signing: true, header_env: true }
end