Class: Datadog::Core::HashHeaderCollection

Inherits:
HeaderCollection show all
Defined in:
lib/datadog/core/header_collection.rb

Overview

A header collection implementation that looks up headers in a Hash.

Instance Method Summary collapse

Methods inherited from HeaderCollection

from_hash

Constructor Details

#initialize(hash) ⇒ HashHeaderCollection

Returns a new instance of HashHeaderCollection.



31
32
33
34
35
36
# File 'lib/datadog/core/header_collection.rb', line 31

def initialize(hash)
  super()
  @hash = {}.tap do |res|
    hash.each_pair { |key, value| res[key.downcase] = value }
  end
end

Instance Method Details

#get(header_name) ⇒ Object



38
39
40
# File 'lib/datadog/core/header_collection.rb', line 38

def get(header_name)
  @hash[header_name.downcase]
end