Sha256: f17ed92268062b4580dc16494158cd970cd2c2c10bf982580c12baea3970742a
Contents?: true
Size: 741 Bytes
Versions: 23
Compression:
Stored size: 741 Bytes
Contents
module Datadog 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
Version data entries
23 entries across 23 versions & 2 rubygems