Class: Datadog::Core::Configuration::OptionDefinition
- Inherits:
-
Object
- Object
- Datadog::Core::Configuration::OptionDefinition
- Defined in:
- lib/datadog/core/configuration/option_definition.rb,
sig/datadog/core/configuration/option_definition.rbs
Overview
Represents a definition for an integration configuration option
Defined Under Namespace
Classes: Builder
Constant Summary collapse
- IDENTITY =
->(new_value, _old_value) { new_value }
Instance Attribute Summary collapse
-
#after_set ⇒ Object
readonly
Returns the value of attribute after_set.
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#default_proc ⇒ Object
readonly
Returns the value of attribute default_proc.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#env_parser ⇒ Object
readonly
Returns the value of attribute env_parser.
-
#is_settings ⇒ Object
readonly
Returns the value of attribute is_settings.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#resetter ⇒ Object
readonly
Returns the value of attribute resetter.
-
#setter ⇒ Object
readonly
Returns the value of attribute setter.
-
#skip_telemetry ⇒ Object
readonly
Returns the value of attribute skip_telemetry.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#type_options ⇒ Object
readonly
Returns the value of attribute type_options.
Instance Method Summary collapse
-
#build(context) ⇒ Object
Creates a new Option, bound to the context provided.
-
#initialize(name, attributes, &block) ⇒ OptionDefinition
constructor
A new instance of OptionDefinition.
Constructor Details
#initialize(name, attributes, &block) ⇒ OptionDefinition
Returns a new instance of OptionDefinition.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/datadog/core/configuration/option_definition.rb', line 26 def initialize(name, attributes, &block) # When a settings is defined using the config DSL, an option is also created. # See Datadog::Core::Configuration::Base::ClassMethods#settings for more details. # This flag is used to indicate that the option is a settings option. @is_settings = attributes[:is_settings] @default = attributes[:default] @default_proc = attributes[:default_proc] @env = attributes[:env] @env_parser = attributes[:env_parser] @name = name.to_sym @after_set = attributes[:after_set] @skip_telemetry = attributes[:skip_telemetry] @resetter = attributes[:resetter] @setter = attributes[:setter] || block || IDENTITY @type = attributes[:type] @type_options = attributes[:type_options] end |
Instance Attribute Details
#after_set ⇒ Object (readonly)
Returns the value of attribute after_set.
12 13 14 |
# File 'lib/datadog/core/configuration/option_definition.rb', line 12 def after_set @after_set end |
#default ⇒ Object (readonly)
Returns the value of attribute default.
12 13 14 |
# File 'lib/datadog/core/configuration/option_definition.rb', line 12 def default @default end |
#default_proc ⇒ Object (readonly)
Returns the value of attribute default_proc.
12 13 14 |
# File 'lib/datadog/core/configuration/option_definition.rb', line 12 def default_proc @default_proc end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
12 13 14 |
# File 'lib/datadog/core/configuration/option_definition.rb', line 12 def env @env end |
#env_parser ⇒ Object (readonly)
Returns the value of attribute env_parser.
12 13 14 |
# File 'lib/datadog/core/configuration/option_definition.rb', line 12 def env_parser @env_parser end |
#is_settings ⇒ Object (readonly)
Returns the value of attribute is_settings.
12 13 14 |
# File 'lib/datadog/core/configuration/option_definition.rb', line 12 def is_settings @is_settings end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/datadog/core/configuration/option_definition.rb', line 12 def name @name end |
#resetter ⇒ Object (readonly)
Returns the value of attribute resetter.
12 13 14 |
# File 'lib/datadog/core/configuration/option_definition.rb', line 12 def resetter @resetter end |
#setter ⇒ Object (readonly)
Returns the value of attribute setter.
12 13 14 |
# File 'lib/datadog/core/configuration/option_definition.rb', line 12 def setter @setter end |
#skip_telemetry ⇒ Object (readonly)
Returns the value of attribute skip_telemetry.
12 13 14 |
# File 'lib/datadog/core/configuration/option_definition.rb', line 12 def skip_telemetry @skip_telemetry end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
12 13 14 |
# File 'lib/datadog/core/configuration/option_definition.rb', line 12 def type @type end |
#type_options ⇒ Object (readonly)
Returns the value of attribute type_options.
12 13 14 |
# File 'lib/datadog/core/configuration/option_definition.rb', line 12 def @type_options end |