Class: OpenTelemetry::Context::Key
- Inherits:
-
Object
- Object
- OpenTelemetry::Context::Key
- Defined in:
- lib/opentelemetry/context/key.rb
Overview
The Key class provides mechanisms to index and access values from a Context
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#get(context = Context.current) ⇒ Object
Returns the value indexed by this Key in the specified context.
-
#initialize(name) ⇒ Key
constructor
private
Use Context.create_key to obtain a Key instance.
Constructor Details
#initialize(name) ⇒ Key
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.
Use Context.create_key to obtain a Key instance.
16 17 18 |
# File 'lib/opentelemetry/context/key.rb', line 16 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/opentelemetry/context/key.rb', line 12 def name @name end |