Sha256: 9528843920b6b5c09c85c8bf21b36aa98ff4245c013b346ebd7be03057849e36
Contents?: true
Size: 807 Bytes
Versions: 3
Compression:
Stored size: 807 Bytes
Contents
require 'ddtrace/contrib/registry' module Datadog module Contrib # Defines registerable behavior for integrations module Registerable def self.included(base) base.extend(ClassMethods) base.include(InstanceMethods) end # Class methods for registerable behavior module ClassMethods def register_as(name, options = {}) registry = options.fetch(:registry, Datadog.registry) auto_patch = options.fetch(:auto_patch, false) registry.add(name, new(name, options), auto_patch) end end # Instance methods for registerable behavior module InstanceMethods attr_reader \ :name def initialize(name, options = {}) @name = name end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ddtrace-0.51.1 | lib/ddtrace/contrib/registerable.rb |
ddtrace-0.51.0 | lib/ddtrace/contrib/registerable.rb |
ddtrace-0.50.0 | lib/ddtrace/contrib/registerable.rb |