Sha256: 05929985455150b50091dd024d9e4a59437a0c332aeed761f54176b40c5ceaaf
Contents?: true
Size: 926 Bytes
Versions: 24
Compression:
Stored size: 926 Bytes
Contents
# frozen_string_literal: true module Datadog module Core module Remote module Transport module HTTP module API # An API configured with adapter and routes class Instance attr_reader \ :adapter, :headers, :spec def initialize(spec, adapter, options = {}) @spec = spec @adapter = adapter @headers = options.fetch(:headers, {}) end def encoder spec.encoder end def call(env) # Add headers to request env, unless empty. env.headers.merge!(headers) unless headers.empty? # Send request env to the adapter. adapter.call(env) end end end end end end end end
Version data entries
24 entries across 24 versions & 2 rubygems