aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http
diff options
context:
space:
mode:
authorMatthew Stopa <matthew.p.stopa@gmail.com>2013-01-20 10:41:02 -0700
committerMatthew Stopa <matthew.p.stopa@gmail.com>2013-01-20 10:41:02 -0700
commit56498b4b9e2e6092e131ba2b2319345a6712bf94 (patch)
treede295da65d9fb3e813575c73fc629816f2160c24 /actionpack/lib/action_dispatch/http
parent03a391482aa6a9d532eb43bb3e697852e0b83618 (diff)
downloadrails-56498b4b9e2e6092e131ba2b2319345a6712bf94.tar.gz
rails-56498b4b9e2e6092e131ba2b2319345a6712bf94.tar.bz2
rails-56498b4b9e2e6092e131ba2b2319345a6712bf94.zip
Add documentation to ActionDispatch::Response
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rw-r--r--actionpack/lib/action_dispatch/http/response.rb7
1 files changed, 7 insertions, 0 deletions
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