From cbded64014e41c386b9c6122da3872d592441f49 Mon Sep 17 00:00:00 2001 From: Marcel Molina Date: Wed, 26 Apr 2006 18:35:53 +0000 Subject: 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 --- actionpack/CHANGELOG | 2 ++ actionpack/lib/action_controller/request.rb | 14 +++++++++++--- 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 path_parameters 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 -- cgit v1.2.3