In: |
cgi.rb
|
Mixin module. It provides the follow functionality groups:
cookies | [RW] | Get the cookies as a hash of cookie-name=>Cookie pairs. |
params | [R] | Get the parameters as a hash of name=>values pairs, where values is an Array. |
Get the raw cookies as a string.
# File cgi.rb, line 950 def raw_cookie env_table["HTTP_COOKIE"] end
Get the raw RFC2965 cookies as a string.
# File cgi.rb, line 955 def raw_cookie2 env_table["HTTP_COOKIE2"] end
Set all the parameters.
# File cgi.rb, line 967 def params=(hash) @params.clear @params.update(hash) end
Get the value for the parameter with a given key.
If the parameter has multiple values, only the first will be retrieved; use params() to get the array of values.
# File cgi.rb, line 1173 def [](key) params = @params[key] value = params[0] if @multipart if value return value elsif defined? StringIO StringIO.new("") else Tempfile.new("CGI") end else Value.new(value || "", params) end end
Return all parameter keys as an array.
# File cgi.rb, line 1190 def keys(*args) @params.keys(*args) end