Documentation for AbstractRequest. Closes #4895. [kevin.clark@gmail.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4277 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Marcel Molina
2006-04-26 18:35:53 +00:00
parent 794d93f7a5
commit cbded64014
2 changed files with 13 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
*SVN*
* Documentation for AbstractRequest. Closes #4895. [kevin.clark@gmail.com]
* Refactor various InstanceTag instance method to class methods. Closes #4800. [skaes@web.de]
* Remove all remaining references to @params in the documentation. [Marcel Molina Jr.]

View File

@@ -1,5 +1,6 @@
module ActionController
# These methods are available in both the production and test Request objects.
# Subclassing AbstractRequest makes these methods available to the request objects used in production and testing,
# CgiRequest and TestRequest
class AbstractRequest
cattr_accessor :relative_url_root
@@ -65,6 +66,7 @@ module ActionController
end
end
# Returns the accepted MIME type for the request
def accepts
@accepts ||=
if @env['HTTP_ACCEPT'].to_s.strip.empty?
@@ -202,15 +204,21 @@ module ActionController
host + port_string
end
def path_parameters=(parameters)
def path_parameters=(parameters) #:nodoc:
@path_parameters = parameters
@symbolized_path_parameters = @parameters = nil
end
def symbolized_path_parameters
# The same as <tt>path_parameters</tt> with explicitly symbolized keys
def symbolized_path_parameters
@symbolized_path_parameters ||= path_parameters.symbolize_keys
end
# Returns a hash with the parameters used to form the path of the request
#
# Example:
#
# {:action => 'my_action', :controller => 'my_controller'}
def path_parameters
@path_parameters ||= {}
end