Class: Datadog::Core::HashHeaderCollection
- Inherits:
-
HeaderCollection
- Object
- HeaderCollection
- Datadog::Core::HashHeaderCollection
- Defined in:
- lib/datadog/core/header_collection.rb
Overview
A header collection implementation that looks up headers in a Hash.
Instance Method Summary collapse
- #get(header_name) ⇒ Object
-
#initialize(hash) ⇒ HashHeaderCollection
constructor
A new instance of HashHeaderCollection.
Methods inherited from HeaderCollection
Constructor Details
#initialize(hash) ⇒ HashHeaderCollection
Returns a new instance of HashHeaderCollection.
29 30 31 32 33 34 |
# File 'lib/datadog/core/header_collection.rb', line 29 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
36 37 38 |
# File 'lib/datadog/core/header_collection.rb', line 36 def get(header_name) @hash[header_name.downcase] end |