Sha256: 0d111f37b75f820e635f756db7cdc013cdf25a36a32efa0475d350d3a8f7b051

Contents?: true

Size: 678 Bytes

Versions: 9

Compression:

Stored size: 678 Bytes

Contents

# frozen_string_literal: true

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

module OpenTelemetry
  class Context
    module Propagation
      # The default getter module provides a common method for reading
      # a key from a carrier that implements +[]+
      module DefaultGetter
        DEFAULT_GETTER = ->(carrier, key) { carrier[key] }
        private_constant :DEFAULT_GETTER

        # Returns a callable that can read a key from a carrier that implements
        # +[]+. Useful for extract operations.
        #
        # @return [Callable]
        def default_getter
          DEFAULT_GETTER
        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_getter.rb
opentelemetry-api-0.9.0 lib/opentelemetry/context/propagation/default_getter.rb
opentelemetry-api-0.8.0 lib/opentelemetry/context/propagation/default_getter.rb
opentelemetry-api-0.7.0 lib/opentelemetry/context/propagation/default_getter.rb
opentelemetry-api-0.6.0 lib/opentelemetry/context/propagation/default_getter.rb
opentelemetry-api-0.5.1 lib/opentelemetry/context/propagation/default_getter.rb
opentelemetry-api-0.5.0 lib/opentelemetry/context/propagation/default_getter.rb
opentelemetry-api-0.4.0 lib/opentelemetry/context/propagation/default_getter.rb
opentelemetry-api-0.3.0 lib/opentelemetry/context/propagation/default_getter.rb