Class: Datadog::Core::HeaderCollection
- Inherits:
-
Object
- Object
- Datadog::Core::HeaderCollection
- Defined in:
- lib/datadog/core/header_collection.rb
Overview
A some-what abstract class representing a collection of headers.
Use the ‘HeaderCollection.from_hash` function to create a header collection from a `Hash`. Another option is to use `HashHeaderCollection` directly.
Direct Known Subclasses
HashHeaderCollection, Tracing::Contrib::Rack::Header::RequestHeaderCollection
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Create a header collection that retrieves headers from the given Hash.
Instance Method Summary collapse
-
#get(header_name) ⇒ Object
Gets a single value of the header with the given name, case insensitive.
Class Method Details
.from_hash(hash) ⇒ Object
Create a header collection that retrieves headers from the given Hash.
This can be useful for testing or other trivial use cases.
24 25 26 |
# File 'lib/datadog/core/header_collection.rb', line 24 def self.from_hash(hash) HashHeaderCollection.new(hash) end |
Instance Method Details
#get(header_name) ⇒ Object
Gets a single value of the header with the given name, case insensitive.
15 16 17 |
# File 'lib/datadog/core/header_collection.rb', line 15 def get(header_name) nil end |