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 /acticles/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 /acticles/index.html => html Defaults to the media_type of the request
10 11 12 |
# File 'lib/volt/server/rack/http_request.rb', line 10 def format path_format || media_type end |
#method ⇒ Object
Returns the request method Allows requests to override the http request method by setting _method
22 23 24 25 26 27 28 |
# File 'lib/volt/server/rack/http_request.rb', line 22 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
31 32 33 |
# File 'lib/volt/server/rack/http_request.rb', line 31 def params super.symbolize_keys end |
#path ⇒ Object
Returns the path_info without the format /blub/index.html => /blub/index
16 17 18 |
# File 'lib/volt/server/rack/http_request.rb', line 16 def path path_format ? path_info[0..path_format.size * -1 - 2] : path_info end |