Sha256: e6fa229a7f1f4963a9a14ce7c0679c3e5e41033fbeff0f927a4e96a72a368a29

Contents?: true

Size: 535 Bytes

Versions: 1

Compression:

Stored size: 535 Bytes

Contents

# frozen_string_literal: true

module ActiveWebhook
  module Verification
    class BaseAdapter < Adapter
      attribute :secret, :data

      def call
        return {} unless secret.present?

        {
          strategy => signature
        }
      end

      protected

      def self.component_name
        "verification"
      end

      def signature
        raise NotImplementedError, "#signature must be implemented."
      end

      def strategy
        self.class.name.delete_suffix("Adapter")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_webhook-1.0.0 lib/active_webhook/verification/base_adapter.rb