Class: Protocol::HTTP::Headers::Merged
- Inherits:
-
Object
- Object
- Protocol::HTTP::Headers::Merged
- 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
- #each {|String, String| ... } ⇒ Object
-
#initialize(*all) ⇒ Merged
constructor
A new instance of Merged.
Constructor Details
#initialize(*all) ⇒ Merged
Returns a new instance of Merged.
234 235 236 |
# File 'lib/protocol/http/headers.rb', line 234 def initialize(*all) @all = all end |
Instance Method Details
#<<(headers) ⇒ Object
238 239 240 |
# File 'lib/protocol/http/headers.rb', line 238 def << headers @all << headers end |
#each {|String, String| ... } ⇒ Object
243 244 245 246 247 248 249 |
# File 'lib/protocol/http/headers.rb', line 243 def each(&block) @all.each do |headers| headers.each do |key, value| yield key.downcase, value.to_s end end end |