diff options
Diffstat (limited to 'lib/net')
-rw-r--r-- | lib/net/http.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index dff0d238dd..512391b19f 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -1302,6 +1302,7 @@ module Net #:nodoc: # Iterates for each header names and values. def each_header #:yield: +key+, +value+ + block_given? or return enum_for(__method__) @header.each do |k,va| yield k, va.join(', ') end @@ -1311,13 +1312,15 @@ module Net #:nodoc: # Iterates for each header names. def each_name(&block) #:yield: +key+ + block_given? or return enum_for(__method__) @header.each_key(&block) end alias each_key each_name # Iterates for each capitalized header names. - def each_capitalized_name(&block) #:yield: +key+ + def each_capitalized_name #:yield: +key+ + block_given? or return enum_for(__method__) @header.each_key do |k| yield capitalize(k) end @@ -1325,6 +1328,7 @@ module Net #:nodoc: # Iterates for each header values. def each_value #:yield: +value+ + block_given? or return enum_for(__method__) @header.each_value do |va| yield va.join(', ') end @@ -1347,6 +1351,7 @@ module Net #:nodoc: # As for #each_header, except the keys are provided in capitalized form. def each_capitalized + block_given? or return enum_for(__method__) @header.each do |k,v| yield capitalize(k), v.join(', ') end |