Sha256: 9bd863c82313426298bc78bc18c9417bd997219df41c182b84e5093b5d6c7376

Contents?: true

Size: 828 Bytes

Versions: 15

Compression:

Stored size: 828 Bytes

Contents

# typed: true

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

15 entries across 15 versions & 1 rubygems

Version Path
ddtrace-1.8.0 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.7.0 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.6.1 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.6.0 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.5.2 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.5.1 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.5.0 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.4.2 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.4.1 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.4.0 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.3.0 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.2.0 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.1.0 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.0.0 lib/datadog/appsec/contrib/integration.rb
ddtrace-1.0.0.beta2 lib/datadog/appsec/contrib/integration.rb