aboutsummaryrefslogtreecommitdiffstats
path: root/lib/webrick/httpservlet/prochandler.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/webrick/httpservlet/prochandler.rb')
-rw-r--r--lib/webrick/httpservlet/prochandler.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/webrick/httpservlet/prochandler.rb b/lib/webrick/httpservlet/prochandler.rb
index 2be3c854c1..2f5aa66f45 100644
--- a/lib/webrick/httpservlet/prochandler.rb
+++ b/lib/webrick/httpservlet/prochandler.rb
@@ -13,7 +13,19 @@ require 'webrick/httpservlet/abstract.rb'
module WEBrick
module HTTPServlet
+ ##
+ # Mounts a proc at a path that accepts a request and response.
+ #
+ # Instead of mounting this servlet with WEBrick::HTTPServer#mount use
+ # WEBrick::HTTPServer#mount_proc:
+ #
+ # server.mount_proc '/' do |req, res|
+ # res.body = 'it worked!'
+ # res.status = 200
+ # end
+
class ProcHandler < AbstractServlet
+ # :stopdoc:
def get_instance(server, *options)
self
end
@@ -27,6 +39,7 @@ module WEBrick
end
alias do_POST do_GET
+ # :startdoc:
end
end