Skip to content

Commit 845eacd

Browse files
BurdetteLamarioquatix
authored andcommitted
[DOC] Doc for CGI.parse
1 parent 53b4a42 commit 845eacd

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/cgi/core.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,14 @@ def print(*options)
384384
stdoutput.print(*options)
385385
end
386386

387-
# Parse an HTTP query string into a hash of key=>value pairs.
387+
# :call-seq:
388+
# CGI.parse(query_string) -> hash
389+
#
390+
# Returns a new hash built from name/value pairs in the given +query_string+:
388391
#
389-
# params = CGI.parse("query_string")
390-
# # {"name1" => ["value1", "value2", ...],
391-
# # "name2" => ["value1", "value2", ...], ... }
392+
# query = 'foo=0&bar=1&foo=2&bar=3'
393+
# CGI.parse(query)
394+
# # => {"foo" => ["0", "2"], "bar" => ["1", "3"]}
392395
#
393396
def self.parse(query)
394397
params = {}

0 commit comments

Comments
 (0)