Sha256: dbb9b903b95ed13631a55bcfb4eb700b6e13c8fda7248c562c8130c7d75f4519
Contents?: true
Size: 757 Bytes
Versions: 17
Compression:
Stored size: 757 Bytes
Contents
module Datadog module Configuration # PinSetup translates a flat hash into a Pin configuration # This class should be removed if we ever remove/refactor the Pin class class PinSetup def initialize(target, opts = {}) @pin = Pin.get_from(target) @opts = opts end def call return unless pin ATTRS.each { |key| pin.public_send("#{key}=", opts[key]) if opts[key] } pin.config = opts.reject { |key, _| ATTRS.include?(key) || DEPRECATED_ATTRS.include?(key) } true end private attr_reader :pin, :opts ATTRS = [:app, :tags, :app_type, :name, :service_name].freeze DEPRECATED_ATTRS = [:tracer].freeze private_constant :ATTRS end end end
Version data entries
17 entries across 17 versions & 2 rubygems