Class: Datadog::Core::HeaderCollection

Inherits:
Object
  • Object
show all
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.

Class Method Summary collapse

Instance Method Summary collapse

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.

Parameters:

  • hash (Hash)

    Hash with the headers.



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.

Parameters:

  • header_name (String)

    Name of the header to get the value of.



15
16
17
# File 'lib/datadog/core/header_collection.rb', line 15

def get(header_name)
  nil
end