Skip to content
On this page

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

module · Ruby 3.2

CGI::QueryExtension

12 instance methods

Mixin module that provides the following:

  1. Access to the CGI environment variables as methods. See documentation to the CGI class for a list of these variables. The methods are exposed by removing the leading HTTP_ (if it exists) and downcasing the name. For example, auth_type will return the environment variable AUTH_TYPE, and accept will return the value for HTTP_ACCEPT.

  2. Access to cookies, including the cookies attribute.

  3. Access to parameters, including the params attribute, and overloading [] to perform parameter value lookup by key.

  4. The initialize_query method, for initializing the above mechanisms, handling multipart forms, and allowing the class to be used in “offline” mode.

Instance methods 12

Attributes
Read & Write

Get the cookies as a hash of cookie-name=>Cookie pairs.

Read

Get the uploaded files as a hash of name=>values pairs

Read

Get the parameters as a hash of name=>values pairs, where values is an Array.