Sha256: 1c6eaa555c7fe612aeae3dbd52b889387a83d5d7ea761445ba70c8758c23b21d

Contents?: true

Size: 941 Bytes

Versions: 9

Compression:

Stored size: 941 Bytes

Contents

# frozen_string_literal: true

# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
  module SDK
    module Baggage
      # SDK implementation of Baggage::Builder
      class Builder
        attr_reader :entries

        def initialize(entries)
          @entries = entries
        end

        # Set key-value in the to-be-created baggage
        #
        # @param [String] key The key to store this value under
        # @param [String] value String value to be stored under key
        def set_value(key, value)
          @entries[key] = value.to_s
        end

        # Removes key from the to-be-created baggage
        #
        # @param [String] key The key to remove
        def remove_value(key)
          @entries.delete(key)
        end

        # Clears all baggage from the to-be-created baggage
        def clear
          @entries.clear
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
opentelemetry-sdk-0.16.0 lib/opentelemetry/sdk/baggage/builder.rb
opentelemetry-sdk-0.15.0 lib/opentelemetry/sdk/baggage/builder.rb
opentelemetry-sdk-0.14.0 lib/opentelemetry/sdk/baggage/builder.rb
opentelemetry-sdk-0.13.1 lib/opentelemetry/sdk/baggage/builder.rb
opentelemetry-sdk-0.13.0 lib/opentelemetry/sdk/baggage/builder.rb
opentelemetry-sdk-0.12.1 lib/opentelemetry/sdk/baggage/builder.rb
opentelemetry-sdk-0.12.0 lib/opentelemetry/sdk/baggage/builder.rb
opentelemetry-sdk-0.11.1 lib/opentelemetry/sdk/baggage/builder.rb
opentelemetry-sdk-0.11.0 lib/opentelemetry/sdk/baggage/builder.rb