Class: Datadog::Core::Configuration::Option::Precedence::Value

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/datadog/core/configuration/option.rb

Overview

Represents an Option precedence level. Each precedence has a ‘numeric` value; higher values means higher precedence. `name` is for inspection purposes only.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(numeric, name, origin) ⇒ Value

Returns a new instance of Value.



31
32
33
34
35
# File 'lib/datadog/core/configuration/option.rb', line 31

def initialize(numeric, name, origin)
  @numeric = numeric
  @name = name
  @origin = origin
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



29
30
31
# File 'lib/datadog/core/configuration/option.rb', line 29

def name
  @name
end

#numericObject

Returns the value of attribute numeric.



29
30
31
# File 'lib/datadog/core/configuration/option.rb', line 29

def numeric
  @numeric
end

#originObject

Returns the value of attribute origin.



29
30
31
# File 'lib/datadog/core/configuration/option.rb', line 29

def origin
  @origin
end

Instance Method Details

#<=>(other) ⇒ Object



37
38
39
40
41
# File 'lib/datadog/core/configuration/option.rb', line 37

def <=>(other)
  return nil unless other.is_a?(Value)

  numeric <=> other.numeric
end