Class: Mammoth::Runtimes::Adapter

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

Overview

Base contract for delivery runtime adapters.

Direct Known Subclasses

ConcurrentAdapter, InlineAdapter

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializevoid



9
# File 'lib/mammoth/runtimes/adapter.rb', line 9

def initialize; end

Class Method Details

.adapter_typeString

Returns adapter type name.

Returns:

  • (String)

    adapter type name



17
18
19
20
# File 'lib/mammoth/runtimes/adapter.rb', line 17

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



12
13
14
# File 'lib/mammoth/runtimes/adapter.rb', line 12

def self.capabilities
  { type: adapter_type }
end