File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ def empty?
191191 # @parameter key [String] The header key.
192192 # @parameter value [String] The raw header value.
193193 def each ( &block )
194- @fields . each ( &block )
194+ self . to_h . each ( &block )
195195 end
196196
197197 # @returns [Boolean] Whether the headers include the specified key.
@@ -279,7 +279,7 @@ def []=(key, value)
279279 # @parameter key [String] The header key.
280280 # @returns [String | Array | Object] The header value.
281281 def [] key
282- to_h [ key ]
282+ self . to_h [ key ]
283283 end
284284
285285 # Merge the headers into this instance.
@@ -403,6 +403,7 @@ def delete(key)
403403 # @parameter hash [Hash] The hash to merge into.
404404 # @parameter key [String] The header key.
405405 # @parameter value [String] The raw header value.
406+ # @parameter trailer [Boolean] Whether this header is in the trailer section.
406407 protected def merge_into ( hash , key , value , trailer = @tail )
407408 if policy = @policy [ key ]
408409 # Check if we're adding to trailers and this header is allowed:
@@ -463,7 +464,7 @@ def inspect
463464 def == other
464465 case other
465466 when Hash
466- to_h == other
467+ self . to_h == other
467468 when Headers
468469 @fields == other . fields
469470 else
Original file line number Diff line number Diff line change 153153 end
154154
155155 it "can enumerate fields" do
156- headers . each . with_index do |field , index |
156+ headers . fields . each_with_index do |field , index |
157157 expect ( field ) . to be == fields [ index ]
158158 end
159159 end
You can’t perform that action at this time.
0 commit comments