Skip to content

Commit

Permalink
[ruby/net-http] [DOC] Correct formatting in header.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
BurdetteLamar authored and matzbot committed Dec 14, 2022
1 parent 693c01d commit d2b8745
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions lib/net/http/header.rb
Expand Up @@ -301,7 +301,7 @@ def get_fields(key)
@header[stringified_downcased_key].dup
end

# :call-seq
# call-seq:
# fetch(key, default_val = nil) {|key| ... } -> object
# fetch(key, default_val = nil) -> value or default_val
#
Expand Down Expand Up @@ -540,7 +540,7 @@ def range
result
end

# :call-seq:
# call-seq:
# set_range(length) -> length
# set_range(offset, length) -> range
# set_range(begin..length) -> range
Expand Down Expand Up @@ -772,6 +772,7 @@ def set_content_type(type, params = {})
# application/x-www-form-urlencoded
#
# Example:
#
# http.form_data = {"q" => "ruby", "lang" => "en"}
# http.form_data = {"q" => ["ruby", "perl"], "lang" => "en"}
# http.set_form_data({"q" => "ruby", "lang" => "en"}, ';')
Expand Down Expand Up @@ -801,12 +802,14 @@ def set_form_data(params, sep = '&')
#
# Each item of params should respond to +each+ and yield 2-3 arguments,
# or an array of 2-3 elements. The arguments yielded should be:
# * The name of the field.
# * The value of the field, it should be a String or a File or IO-like.
# * An options hash, supporting the following options, only
# used for file uploads:
# :filename :: The name of the file to use.
# :content_type :: The content type of the uploaded file.
#
# - The name of the field.
# - The value of the field, it should be a String or a File or IO-like.
# - An options hash, supporting the following options
# (used only for file uploads); entries:
#
# - +:filename+: The name of the file to use.
# - +:content_type+: The content type of the uploaded file.
#
# Each item is a file field or a normal field.
# If +value+ is a File object or the +opt+ hash has a :filename key,
Expand All @@ -818,6 +821,7 @@ def set_form_data(params, sep = '&')
# chunked encoding.
#
# Example:
#
# req.set_form([["q", "ruby"], ["lang", "en"]])
#
# req.set_form({"f"=>File.open('/path/to/filename')},
Expand Down

0 comments on commit d2b8745

Please sign in to comment.