Class: OpenTelemetry::Context::Propagation::TextMapGetter

Inherits:
Object
  • Object
show all
Defined in:
lib/opentelemetry/context/propagation/text_map_getter.rb

Overview

The default getter module provides a common methods for reading key from a carrier that implements [] and a keys method

Instance Method Summary collapse

Instance Method Details

#get(carrier, key) ⇒ Object

Reads a key from a carrier that implements []. Useful for extract operations.



15
16
17
# File 'lib/opentelemetry/context/propagation/text_map_getter.rb', line 15

def get(carrier, key)
  carrier[key]
end

#keys(carrier) ⇒ Object

Reads all keys from a carrier. Useful for iterating over a carrier's keys.



21
22
23
# File 'lib/opentelemetry/context/propagation/text_map_getter.rb', line 21

def keys(carrier)
  carrier.keys
end