Class: Inspec::Resources::Http::Headers

Inherits:
Hash
  • Object
show all
Defined in:
lib/resources/http.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Hash

#contains, #deep_merge, #smash

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(requested_key) ⇒ Object



248
249
250
# File 'lib/resources/http.rb', line 248

def method_missing(requested_key)
  fetch(requested_key.to_s.downcase, nil)
end

Class Method Details

.create(header_data) ⇒ Object



240
241
242
# File 'lib/resources/http.rb', line 240

def self.create(header_data)
  header_data.each_with_object(new) { |(k, v), memo| memo[k.to_s.downcase] = v }
end

Instance Method Details

#[](requested_key) ⇒ Object



244
245
246
# File 'lib/resources/http.rb', line 244

def [](requested_key)
  fetch(requested_key.downcase, nil)
end