summary refs log tree commit
diff options
context:
space:
mode:
authorKonstantin Haase <konstantin.mailinglists@googlemail.com>2011-03-18 15:05:32 +0100
committerKonstantin Haase <konstantin.mailinglists@googlemail.com>2011-03-18 15:05:32 +0100
commit828e2ab0396c5bbf4b5ccd76e6392a475633a81f (patch)
tree0ff4cb2984c0094fffd33de019be35e0f911e8a8
parent889e2bcd658b9437d7fd5e023b59ad868e38f878 (diff)
downloadrack-828e2ab0396c5bbf4b5ccd76e6392a475633a81f.tar.gz
add Rack::Request#patch?
-rw-r--r--lib/rack/request.rb1
-rw-r--r--test/spec_request.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/rack/request.rb b/lib/rack/request.rb
index 5ebd72ea..db3a5413 100644
--- a/lib/rack/request.rb
+++ b/lib/rack/request.rb
@@ -117,6 +117,7 @@ module Rack
     def get?;     request_method == "GET"     end
     def head?;    request_method == "HEAD"    end
     def options?; request_method == "OPTIONS" end
+    def patch?;   request_method == "PATCH"   end
     def post?;    request_method == "POST"    end
     def put?;     request_method == "PUT"     end
     def trace?;   request_method == "TRACE"   end
diff --git a/test/spec_request.rb b/test/spec_request.rb
index ddaa172b..bd57af4d 100644
--- a/test/spec_request.rb
+++ b/test/spec_request.rb
@@ -16,6 +16,7 @@ describe Rack::Request do
     req.should.not.be.put
     req.should.not.be.delete
     req.should.not.be.head
+    req.should.not.be.patch
 
     req.script_name.should.equal ""
     req.path_info.should.equal "/"