aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2006-04-26 18:35:53 +0000
committerMarcel Molina <marcel@vernix.org>2006-04-26 18:35:53 +0000
commitcbded64014e41c386b9c6122da3872d592441f49 (patch)
tree9c14078c13b4be415250b3e313de9d914cee48a3 /actionpack
parent794d93f7a5ede9801929ef2a5292a0380f0700b5 (diff)
downloadrails-cbded64014e41c386b9c6122da3872d592441f49.tar.gz
rails-cbded64014e41c386b9c6122da3872d592441f49.tar.bz2
rails-cbded64014e41c386b9c6122da3872d592441f49.zip
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
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG2
-rwxr-xr-xactionpack/lib/action_controller/request.rb14
2 files changed, 13 insertions, 3 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index b35eb80978..b95b003c2d 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -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.]
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb
index 76257c1dbb..86547919b9 100755
--- a/actionpack/lib/action_controller/request.rb
+++ b/actionpack/lib/action_controller/request.rb
@@ -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