mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove already defined methods in super class of ActionDispatch::Request class
These methods had defined in 2004 by dhh in initial commit and `ActionDispatch::Request` class has been inherited from `Rack::Request` class in 2009 by josh. In 2014 these methods and more of them defined in `Rack::Request` class so we don't need them anymore in rails codebase.
This commit is contained in:
parent
7cc9754209
commit
9a16a29f40
1 changed files with 0 additions and 36 deletions
|
@ -141,42 +141,6 @@ module ActionDispatch
|
||||||
HTTP_METHOD_LOOKUP[method]
|
HTTP_METHOD_LOOKUP[method]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Is this a GET (or HEAD) request?
|
|
||||||
# Equivalent to <tt>request.request_method_symbol == :get</tt>.
|
|
||||||
def get?
|
|
||||||
HTTP_METHOD_LOOKUP[request_method] == :get
|
|
||||||
end
|
|
||||||
|
|
||||||
# Is this a POST request?
|
|
||||||
# Equivalent to <tt>request.request_method_symbol == :post</tt>.
|
|
||||||
def post?
|
|
||||||
HTTP_METHOD_LOOKUP[request_method] == :post
|
|
||||||
end
|
|
||||||
|
|
||||||
# Is this a PATCH request?
|
|
||||||
# Equivalent to <tt>request.request_method == :patch</tt>.
|
|
||||||
def patch?
|
|
||||||
HTTP_METHOD_LOOKUP[request_method] == :patch
|
|
||||||
end
|
|
||||||
|
|
||||||
# Is this a PUT request?
|
|
||||||
# Equivalent to <tt>request.request_method_symbol == :put</tt>.
|
|
||||||
def put?
|
|
||||||
HTTP_METHOD_LOOKUP[request_method] == :put
|
|
||||||
end
|
|
||||||
|
|
||||||
# Is this a DELETE request?
|
|
||||||
# Equivalent to <tt>request.request_method_symbol == :delete</tt>.
|
|
||||||
def delete?
|
|
||||||
HTTP_METHOD_LOOKUP[request_method] == :delete
|
|
||||||
end
|
|
||||||
|
|
||||||
# Is this a HEAD request?
|
|
||||||
# Equivalent to <tt>request.request_method_symbol == :head</tt>.
|
|
||||||
def head?
|
|
||||||
HTTP_METHOD_LOOKUP[request_method] == :head
|
|
||||||
end
|
|
||||||
|
|
||||||
# Provides access to the request's HTTP headers, for example:
|
# Provides access to the request's HTTP headers, for example:
|
||||||
#
|
#
|
||||||
# request.headers["Content-Type"] # => "text/plain"
|
# request.headers["Content-Type"] # => "text/plain"
|
||||||
|
|
Loading…
Reference in a new issue