Sha256: 01adc243c05384aea55109535e8587fe928ec7dc1dc9f4503e602a4203d2f887
Contents?: true
Size: 788 Bytes
Versions: 4
Compression:
Stored size: 788 Bytes
Contents
# typed: false 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, Contrib::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
4 entries across 4 versions & 1 rubygems