Sha256: 453f92919212aa7d224854ace72f0e66747579035d841c9887f1e50f01c91269

Contents?: true

Size: 813 Bytes

Versions: 3

Compression:

Stored size: 813 Bytes

Contents

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

3 entries across 3 versions & 1 rubygems

Version Path
ddtrace-1.10.1 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.10.0 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.0.0.beta1 lib/datadog/appsec/contrib/integration.rb