Sha256: 145de2856a009a59a1fd61200b9bccf6eda8dcc20c8260725473af351251146c

Contents?: true

Size: 830 Bytes

Versions: 1

Compression:

Stored size: 830 Bytes

Contents

# typed: ignore

module Datadog
  module AppSec
    module Contrib
      # Base provides features that are shared across all integrations
      module Integration
        @registry = {}

        RegisteredIntegration = Struct.new(:name, :klass, :options)

        def self.included(base)
          base.extend(ClassMethods)
        end

        # Class-level methods for Integration
        module ClassMethods
          def register_as(name, options = {})
            Integration.register(self, name, options)
          end

          def compatible?
            true
          end
        end

        def self.register(integration, name, options)
          registry[name] = RegisteredIntegration.new(name, integration, options)
        end

        def self.registry
          @registry
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ddtrace-1.9.0 lib/datadog/appsec/contrib/integration.rb