Sha256: b0fe1d97e14e22c35472f850b4c334633eb7debb51923bdcd0895b6956485236

Contents?: true

Size: 776 Bytes

Versions: 3

Compression:

Stored size: 776 Bytes

Contents

# frozen_string_literal: true

module ElasticAPM
  class Span
    # @api private
    class Context
      def initialize(
        db: nil,
        destination: nil,
        http: nil,
        labels: {},
        sync: nil
      )
        @sync = sync
        @db = db && Db.new(**db)
        @http = http && Http.new(**http)
        @destination =
          case destination
          when Destination then destination
          when Hash then Destination.new(**destination)
          end
        @labels = labels
      end

      attr_reader(
        :db,
        :destination,
        :http,
        :labels,
        :sync
      )
    end
  end
end

require 'elastic_apm/span/context/db'
require 'elastic_apm/span/context/http'
require 'elastic_apm/span/context/destination'

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
elastic-apm-3.6.0 lib/elastic_apm/span/context.rb
elastic-apm-3.5.0 lib/elastic_apm/span/context.rb
elastic-apm-3.4.0 lib/elastic_apm/span/context.rb