Class: Rack::Utils::HeaderHash Private
- Inherits:
-
Hash
- Object
- Hash
- Rack::Utils::HeaderHash
- Defined in:
- lib/rack/utils.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A wrapper around Headers header when set.
Class Method Summary collapse
-
.[](headers) ⇒ Object
private
:nodoc:.
- .allocate ⇒ Object private
- .new(hash = {}) ⇒ Object private
Class Method Details
.[](headers) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
:nodoc:
521 522 523 524 525 526 527 528 529 530 |
# File 'lib/rack/utils.rb', line 521 def self.[](headers) warn "Rack::Utils::HeaderHash is deprecated and will be removed in Rack 3.1, switch to Rack::Headers", uplevel: 1 if headers.is_a?(Headers) && !headers.frozen? return headers end new_headers = Headers.new headers.each{|k,v| new_headers[k] = v} new_headers end |
.allocate ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
539 540 541 |
# File 'lib/rack/utils.rb', line 539 def self.allocate raise TypeError, "cannot allocate HeaderHash" end |
.new(hash = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
532 533 534 535 536 537 |
# File 'lib/rack/utils.rb', line 532 def self.new(hash = {}) warn "Rack::Utils::HeaderHash is deprecated and will be removed in Rack 3.1, switch to Rack::Headers", uplevel: 1 headers = Headers.new hash.each{|k,v| headers[k] = v} headers end |