Class: Volt::HttpRequest
- Defined in:
- lib/volt/server/rack/http_request.rb
Overview
A request object for a HttpController. See Rack::Request for more details
Instance Method Summary collapse
-
#format ⇒ Object
Returns the request format /blub/index.html => html Defaults to the media_type of the request.
-
#method ⇒ Object
Returns the request method Allows requests to override the http request method by setting _method.
-
#params ⇒ Object
The request params with symbolized keys.
-
#path ⇒ Object
Returns the path_info without the format /blub/index.html => /blub/index.
Instance Method Details
#format ⇒ Object
Returns the request format /blub/index.html => html Defaults to the media_type of the request
12 13 14 |
# File 'lib/volt/server/rack/http_request.rb', line 12 def format path_format || media_type end |
#method ⇒ Object
Returns the request method Allows requests to override the http request method by setting _method
24 25 26 27 28 29 30 |
# File 'lib/volt/server/rack/http_request.rb', line 24 def method if params[:_method] params[:_method].to_s.downcase.to_sym else request_method.downcase.to_sym end end |
#params ⇒ Object
The request params with symbolized keys
33 34 35 |
# File 'lib/volt/server/rack/http_request.rb', line 33 def params super.symbolize_keys end |
#path ⇒ Object
Returns the path_info without the format /blub/index.html => /blub/index
18 19 20 |
# File 'lib/volt/server/rack/http_request.rb', line 18 def path path_format ? path_info[0..path_format.size * -1 - 2] : path_info end |