Sha256: 5238da501b974d23c2cb7c781243a6519e44cc33c7537899e6cf3f543798af41
Contents?: true
Size: 689 Bytes
Versions: 38
Compression:
Stored size: 689 Bytes
Contents
module Datadog class 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) } true end private attr_reader :pin, :opts ATTRS = [:app, :tags, :app_type, :name, :tracer, :service_name].freeze private_constant :ATTRS end end end
Version data entries
38 entries across 38 versions & 1 rubygems