Class: OpenTelemetry::Baggage::Builder
- Inherits:
-
Object
- Object
- OpenTelemetry::Baggage::Builder
- Defined in:
- lib/opentelemetry/baggage/builder.rb
Overview
Operational implementation of Baggage::Builder
Instance Attribute Summary collapse
- #entries ⇒ Object readonly private
Instance Method Summary collapse
-
#clear ⇒ Object
Clears all baggage from the to-be-created baggage.
-
#initialize(entries) ⇒ Builder
constructor
private
A new instance of Builder.
-
#remove_value(key) ⇒ Object
Removes key from the to-be-created baggage.
-
#set_value(key, value, metadata: nil) ⇒ Object
Set key-value in the to-be-created baggage.
Constructor Details
#initialize(entries) ⇒ Builder
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 Builder.
15 16 17 |
# File 'lib/opentelemetry/baggage/builder.rb', line 15 def initialize(entries) @entries = entries end |
Instance Attribute Details
#entries ⇒ Object (readonly)
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.
12 13 14 |
# File 'lib/opentelemetry/baggage/builder.rb', line 12 def entries @entries end |
Instance Method Details
#clear ⇒ Object
Clears all baggage from the to-be-created baggage
39 40 41 |
# File 'lib/opentelemetry/baggage/builder.rb', line 39 def clear @entries.clear end |
#remove_value(key) ⇒ Object
Removes key from the to-be-created baggage
34 35 36 |
# File 'lib/opentelemetry/baggage/builder.rb', line 34 def remove_value(key) @entries.delete(key) end |
#set_value(key, value, metadata: nil) ⇒ Object
Set key-value in the to-be-created baggage
27 28 29 |
# File 'lib/opentelemetry/baggage/builder.rb', line 27 def set_value(key, value, metadata: nil) @entries[key] = OpenTelemetry::Baggage::Entry.new(value, ) end |