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.
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 |