Module | CGI::QueryExtension |
In: |
lib/cgi.rb
|
Mixin module. It provides the follow functionality groups:
path | -> | local_path |
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 lib/cgi.rb, line 1169 def [](key) params = @params[key] return '' unless params value = params[0] if @multipart if value return value elsif defined? StringIO StringIO.new("") else Tempfile.new("CGI") end else str = if value then value.dup else "" end str.extend(Value) str.set_params(params) str end end
Returns true if a given parameter key exists in the query.
# File lib/cgi.rb, line 1195 def has_key?(*args) @params.has_key?(*args) end
Get the raw cookies as a string.
# File lib/cgi.rb, line 951 def raw_cookie env_table["HTTP_COOKIE"] end