Class: Datadog::Core::Configuration::OptionDefinition
- Inherits:
 - 
      Object
      
        
- Object
 - Datadog::Core::Configuration::OptionDefinition
 
 
- Defined in:
 - lib/datadog/core/configuration/option_definition.rb
 
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.
 - 
  
    
      #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.
 - 
  
    
      #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, meta, &block)  ⇒ OptionDefinition 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of OptionDefinition.
 
Constructor Details
#initialize(name, meta, &block) ⇒ OptionDefinition
Returns a new instance of OptionDefinition.
      24 25 26 27 28 29 30 31 32 33 34 35  | 
    
      # File 'lib/datadog/core/configuration/option_definition.rb', line 24 def initialize(name, , &block) @default = [:default] @default_proc = [:default_proc] @env = [:env] @env_parser = [:env_parser] @name = name.to_sym @after_set = [:after_set] @resetter = [:resetter] @setter = [:setter] || block || IDENTITY @type = [:type] @type_options = [: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  | 
  
#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  | 
  
#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  |