1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add documentation to ActionDispatch::Response

This commit is contained in:
Matthew Stopa 2013-01-20 10:41:02 -07:00
parent 03a391482a
commit 56498b4b9e

View file

@ -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