Sha256: 0322c82145e6dc9bdf6e796abd9a0f8e95c77023d0700c74b992df90117b501e
Contents?: true
Size: 715 Bytes
Versions: 24
Compression:
Stored size: 715 Bytes
Contents
module Datadog module Contrib module Configuration # Represents an instance of an integration configuration option class Option attr_reader \ :definition def initialize(definition, context) @definition = definition @context = context @value = nil @is_set = false end def set(value) @value = @context.instance_exec(value, &definition.setter).tap do @is_set = true end end def get return definition.default_value unless @is_set @value end def reset set(definition.default_value) end end end end end
Version data entries
24 entries across 24 versions & 1 rubygems