Class: Bijou::CGI::Request

Inherits:
HttpRequest show all
Defined in:
lib/bijou/cgi/request.rb

Overview

The request object adapts the CGI environment to a standardized Bijou interface. The normal Ruby cgi class is not used in this case. The Bijou::MiniCGI class adapts some of the useful functionality provided by the normal cgi class for use from the request object.

Instance Attribute Summary collapse

Attributes inherited from HttpRequest

#cookies, #form, #http_method, #params, #query_string, #server_variables

Instance Method Summary collapse

Methods inherited from HttpRequest

#get, #physical_path, #post, #referer, #referrer, #request_method, #user_agent, #virtual_path

Constructor Details

#initialize(single = true) ⇒ Request

Set single to true to have request parameters with single values be converted from an array to a single value. Otherwise, all parameter values will be arrays.



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/bijou/cgi/request.rb', line 20

def initialize(single=true)
  super()

  @cgi = Bijou::MiniCGI.new(single)

  @params = @cgi.params
  @query_string = @cgi.get
  @form = @cgi.post
  @cookies = @cgi.cookies
  @server_variables = @cgi.server
  @http_method = @cgi.method
end

Instance Attribute Details

#cgiObject (readonly)

Returns the value of attribute cgi.



33
34
35
# File 'lib/bijou/cgi/request.rb', line 33

def cgi
  @cgi
end