Class: HTTP::Protocol::Headers::Merged
- Inherits:
-
Object
- Object
- HTTP::Protocol::Headers::Merged
- Defined in:
- lib/http/protocol/headers.rb
Overview
Used for merging objects into a sequential list of headers. Normalizes header keys and values.
Instance Method Summary collapse
- #<<(headers) ⇒ Object
- #each {|String, String| ... } ⇒ Object
-
#initialize(*all) ⇒ Merged
constructor
A new instance of Merged.
Constructor Details
#initialize(*all) ⇒ Merged
Returns a new instance of Merged.
201 202 203 |
# File 'lib/http/protocol/headers.rb', line 201 def initialize(*all) @all = all end |
Instance Method Details
#<<(headers) ⇒ Object
205 206 207 |
# File 'lib/http/protocol/headers.rb', line 205 def << headers @all << headers end |
#each {|String, String| ... } ⇒ Object
210 211 212 213 214 215 216 |
# File 'lib/http/protocol/headers.rb', line 210 def each(&block) @all.each do |headers| headers.each do |key, value| yield key.downcase, value.to_s end end end |