提交 308517e9 编写于 作者: J John Firebaugh 提交者: José Valim

Don't duplicate Rack::Response functionality. [#5320 state:resolved]

Signed-off-by: NJosé Valim <jose.valim@gmail.com>
上级 c5093799
......@@ -15,29 +15,15 @@ def self.from_response(response)
end
# Was the response successful?
def success?
(200..299).include?(response_code)
end
alias_method :success?, :successful?
# Was the URL not found?
def missing?
response_code == 404
end
alias_method :missing?, :not_found?
# Were we redirected?
def redirect?
(300..399).include?(response_code)
end
alias_method :redirect?, :redirection?
# Was there a server-side error?
def error?
(500..599).include?(response_code)
end
alias_method :server_error?, :error?
# Was there a client client?
def client_error?
(400..499).include?(response_code)
end
alias_method :error?, :server_error?
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册