Class: OpenTelemetry::SDK::Baggage::Builder
- Inherits:
-
Object
- Object
- OpenTelemetry::SDK::Baggage::Builder
- Defined in:
- lib/opentelemetry/sdk/baggage/builder.rb
Overview
SDK implementation of Baggage::Builder
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
Instance Method Summary collapse
-
#clear ⇒ Object
Clears all baggage from the to-be-created baggage.
-
#initialize(entries) ⇒ Builder
constructor
A new instance of Builder.
-
#remove_value(key) ⇒ Object
Removes key from the to-be-created baggage.
-
#set_value(key, value) ⇒ Object
Set key-value in the to-be-created baggage.
Constructor Details
#initialize(entries) ⇒ Builder
Returns a new instance of Builder.
14 15 16 |
# File 'lib/opentelemetry/sdk/baggage/builder.rb', line 14 def initialize(entries) @entries = entries end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
12 13 14 |
# File 'lib/opentelemetry/sdk/baggage/builder.rb', line 12 def entries @entries end |
Instance Method Details
#clear ⇒ Object
Clears all baggage from the to-be-created baggage
34 35 36 |
# File 'lib/opentelemetry/sdk/baggage/builder.rb', line 34 def clear @entries.clear end |
#remove_value(key) ⇒ Object
Removes key from the to-be-created baggage
29 30 31 |
# File 'lib/opentelemetry/sdk/baggage/builder.rb', line 29 def remove_value(key) @entries.delete(key) end |
#set_value(key, value) ⇒ Object
Set key-value in the to-be-created baggage
22 23 24 |
# File 'lib/opentelemetry/sdk/baggage/builder.rb', line 22 def set_value(key, value) @entries[key] = value.to_s end |