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:
parent
03a391482a
commit
56498b4b9e
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue