Permalink
Browse files

added some comments to HTTP verb checks, for the rdoc

  • Loading branch information...
1 parent c3a1348 commit d7decc4624c22e3cf6bf84aeb560163e89a45947 @yb66 yb66 committed Sep 13, 2011
Showing with 17 additions and 0 deletions.
  1. +17 −0 lib/rack/request.rb
View
@@ -113,15 +113,32 @@ def host
def script_name=(s); @env["SCRIPT_NAME"] = s.to_s end
def path_info=(s); @env["PATH_INFO"] = s.to_s end
+
+ # Checks the HTTP request method (or verb) to see if it was of type DELETE
def delete?; request_method == "DELETE" end
+
+ # Checks the HTTP request method (or verb) to see if it was of type GET
def get?; request_method == "GET" end
+
+ # Checks the HTTP request method (or verb) to see if it was of type HEAD
def head?; request_method == "HEAD" end
+
+ # Checks the HTTP request method (or verb) to see if it was of type OPTIONS
def options?; request_method == "OPTIONS" end
+
+ # Checks the HTTP request method (or verb) to see if it was of type PATCH
def patch?; request_method == "PATCH" end
+
+ # Checks the HTTP request method (or verb) to see if it was of type POST
def post?; request_method == "POST" end
+
+ # Checks the HTTP request method (or verb) to see if it was of type PUT
def put?; request_method == "PUT" end
+
+ # Checks the HTTP request method (or verb) to see if it was of type TRACE
def trace?; request_method == "TRACE" end
+
# The set of form-data media-types. Requests that do not indicate
# one of the media types presents in this list will not be eligible
# for form-data / param parsing.

0 comments on commit d7decc4

Please sign in to comment.