Class: Atatus::TraceContext::Tracestate::EsEntry Private

Inherits:
Object
  • Object
show all
Defined in:
lib/atatus/trace_context/tracestate.rb

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

Constant Summary collapse

ASSIGN =

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

':'
SPLIT =

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

';'
SHORT_TO_LONG =

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

{ 's' => 'sample_rate' }
LONG_TO_SHORT =

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

{ 'sample_rate' => 's' }

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values = nil) ⇒ EsEntry

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 a new instance of EsEntry.



45
46
47
# File 'lib/atatus/trace_context/tracestate.rb', line 45

def initialize(values = nil)
  parse(values)
end

Instance Attribute Details

#sample_rateObject

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.



49
50
51
# File 'lib/atatus/trace_context/tracestate.rb', line 49

def sample_rate
  @sample_rate
end

Instance Method Details

#empty?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)


61
62
63
# File 'lib/atatus/trace_context/tracestate.rb', line 61

def empty?
  !sample_rate
end

#keyObject

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.



51
52
53
# File 'lib/atatus/trace_context/tracestate.rb', line 51

def key
  'es'
end

#to_sObject

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.



75
76
77
78
79
# File 'lib/atatus/trace_context/tracestate.rb', line 75

def to_s
  return nil if empty?

  "es=#{value}"
end

#valueObject

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.



55
56
57
58
59
# File 'lib/atatus/trace_context/tracestate.rb', line 55

def value
  LONG_TO_SHORT.map do |l, s|
    "#{s}#{ASSIGN}#{send(l)}"
  end.join(SPLIT)
end