Class: Mammoth::Destinations::Adapter

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

Overview

Base contract for destination adapters.

Direct Known Subclasses

WebhookAdapter

Class Method Summary collapse

Class Method Details

.adapter_typeString

Returns adapter type name.

Returns:

  • (String)

    adapter type name



14
15
16
17
# File 'lib/mammoth/destinations/adapter.rb', line 14

def self.adapter_type
  type = name.split("::").last.to_s.delete_suffix("Adapter").downcase
  type.empty? ? "adapter" : type
end

.capabilitiesHash

Returns JSON-friendly adapter capabilities.

Returns:

  • (Hash)

    JSON-friendly adapter capabilities



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

def self.capabilities
  { type: adapter_type }
end