From 56498b4b9e2e6092e131ba2b2319345a6712bf94 Mon Sep 17 00:00:00 2001 From: Matthew Stopa Date: Sun, 20 Jan 2013 10:41:02 -0700 Subject: Add documentation to ActionDispatch::Response --- actionpack/lib/action_dispatch/http/response.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionpack/lib/action_dispatch/http') diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index 2a146dbb8f..845fa2ec1f 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -137,6 +137,7 @@ module ActionDispatch # :nodoc: @committed end + # Allows you to set the HTTP status code def status=(status) @status = Rack::Utils.status_code(status) end @@ -155,6 +156,12 @@ module ActionDispatch # :nodoc: @status.to_s end + # 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 -- cgit v1.2.3