Module: OpenTelemetry::SDK::Internal Private

Extended by:
Internal
Included in:
Internal
Defined in:
lib/opentelemetry/sdk/internal.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Internal contains helpers used by the reference implementation.

Instance Method Summary collapse

Instance Method Details

#boolean?(value) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


15
16
17
# File 'lib/opentelemetry/sdk/internal.rb', line 15

def boolean?(value)
  value.is_a?(TrueClass) || value.is_a?(FalseClass)
end

#valid_attributes?(attrs) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


27
28
29
# File 'lib/opentelemetry/sdk/internal.rb', line 27

def valid_attributes?(attrs)
  attrs.nil? || attrs.all? { |k, v| valid_key?(k) && valid_value?(v) }
end

#valid_key?(key) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


19
20
21
# File 'lib/opentelemetry/sdk/internal.rb', line 19

def valid_key?(key)
  key.instance_of?(String)
end

#valid_value?(value) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


23
24
25
# File 'lib/opentelemetry/sdk/internal.rb', line 23

def valid_value?(value)
  value.instance_of?(String) || value == false || value == true || value.is_a?(Numeric)
end