Sha256: 02e67975fef137afe8e3d7cd5124f07bf4a61130a48f292817520509942eb62a

Contents?: true

Size: 695 Bytes

Versions: 9

Compression:

Stored size: 695 Bytes

Contents

# frozen_string_literal: true

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

module OpenTelemetry
  class Context
    module Propagation
      # The default setter module provides a common method for writing
      # a key into a carrier that implements +[]=+
      module DefaultSetter
        DEFAULT_SETTER = ->(carrier, key, value) { carrier[key] = value }
        private_constant :DEFAULT_SETTER

        # Returns a callable that can write a key into a carrier that implements
        # +[]=+. Useful for inject operations.
        #
        # @return [Callable]
        def default_setter
          DEFAULT_SETTER
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
opentelemetry-api-0.10.0 lib/opentelemetry/context/propagation/default_setter.rb
opentelemetry-api-0.9.0 lib/opentelemetry/context/propagation/default_setter.rb
opentelemetry-api-0.8.0 lib/opentelemetry/context/propagation/default_setter.rb
opentelemetry-api-0.7.0 lib/opentelemetry/context/propagation/default_setter.rb
opentelemetry-api-0.6.0 lib/opentelemetry/context/propagation/default_setter.rb
opentelemetry-api-0.5.1 lib/opentelemetry/context/propagation/default_setter.rb
opentelemetry-api-0.5.0 lib/opentelemetry/context/propagation/default_setter.rb
opentelemetry-api-0.4.0 lib/opentelemetry/context/propagation/default_setter.rb
opentelemetry-api-0.3.0 lib/opentelemetry/context/propagation/default_setter.rb