diff options
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/response.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index 845fa2ec1f..e7e8905d7e 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -137,7 +137,7 @@ module ActionDispatch # :nodoc: @committed end - # Allows you to set the HTTP status code + # Sets the HTTP status code. def status=(status) @status = Rack::Utils.status_code(status) end @@ -146,22 +146,24 @@ module ActionDispatch # :nodoc: @content_type = content_type.to_s end - # The response code of the request + # The response code of the request. def response_code @status end - # Returns a String to ensure compatibility with Net::HTTPResponse + # Returns a string to ensure compatibility with <tt>Net::HTTPResponse</tt>. def code @status.to_s end - # Returns the corresponding message for the current HTTP status code + # Returns the corresponding message for the current HTTP status code: + # # response.status = 200 # response.message # => "OK" # # response.status = 404 # response.message # => "Not Found" + # def message Rack::Utils::HTTP_STATUS_CODES[@status] end @@ -179,7 +181,7 @@ module ActionDispatch # :nodoc: stream.to_path end - # Returns the content of the response as a String. This contains the contents + # Returns the content of the response as a string. This contains the contents # of any calls to <tt>render</tt>. def body strings = [] |