Class: Bijou::WEBrick::Request
- Inherits:
-
HttpRequest
- Object
- HttpRequest
- Bijou::WEBrick::Request
- Defined in:
- lib/bijou/webrick/request.rb
Instance Attribute Summary collapse
-
#req ⇒ Object
readonly
Returns the value of attribute req.
Attributes inherited from HttpRequest
#cookies, #form, #http_method, #params, #query_string, #server_variables
Instance Method Summary collapse
-
#initialize(req) ⇒ Request
constructor
Accepts a WEBrick::HTTPRequest object and adapts it to the HttpRequest object expected by the Bijou component.
-
#virtual_path ⇒ Object
– TODO: Standardize accessor name.
Methods inherited from HttpRequest
#get, #physical_path, #post, #referer, #referrer, #request_method, #user_agent
Constructor Details
#initialize(req) ⇒ Request
Accepts a WEBrick::HTTPRequest object and adapts it to the HttpRequest object expected by the Bijou component.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/bijou/webrick/request.rb', line 12 def initialize(req) super() @req = req if @req.query_string query_string = ::CGI::parse(@req.query_string) || {} @query_string = Bijou::MiniCGI.singularize(query_string) else @query_string = {} end @form = @query_string.clone @params = @query_string.clone #cookies = ::CGI::Cookie::parse(@req.cookies) @cookies = @req. @http_method = @req.request_method end |
Instance Attribute Details
#req ⇒ Object (readonly)
Returns the value of attribute req.
33 34 35 |
# File 'lib/bijou/webrick/request.rb', line 33 def req @req end |
Instance Method Details
#virtual_path ⇒ Object
– TODO: Standardize accessor name. ++
38 39 40 41 42 |
# File 'lib/bijou/webrick/request.rb', line 38 def virtual_path # @server_variables['REQUEST_URI'] # @server_variables['PATH_INFO'] @req.request_uri end |