Class: Protocol::HTTP::Headers::Merged
- Inherits:
-
Object
- Object
- Protocol::HTTP::Headers::Merged
- Includes:
- Enumerable
- Defined in:
- lib/protocol/http/headers.rb
Overview
Used for merging objects into a sequential list of headers. Normalizes header keys and values.
Instance Method Summary collapse
- #<<(headers) ⇒ Object
- #clear ⇒ 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.
236 237 238 |
# File 'lib/protocol/http/headers.rb', line 236 def initialize(*all) @all = all end |
Instance Method Details
#<<(headers) ⇒ Object
244 245 246 247 248 |
# File 'lib/protocol/http/headers.rb', line 244 def << headers @all << headers return self end |
#clear ⇒ Object
240 241 242 |
# File 'lib/protocol/http/headers.rb', line 240 def clear @all.clear end |
#each {|String, String| ... } ⇒ Object
251 252 253 254 255 256 257 |
# File 'lib/protocol/http/headers.rb', line 251 def each(&block) @all.each do |headers| headers.each do |key, value| yield key.downcase, value.to_s end end end |