about summary refs log tree commit homepage
path: root/lib/mongrel/handlers.rb
diff options
context:
space:
mode:
authorzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-03-25 21:15:30 +0000
committerzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-03-25 21:15:30 +0000
commitf4a5c938d461d9c5dc17f521c9efaaf352b931fa (patch)
treec8f5d6799e74a4b9dd6d533424ee093ef4d3beb4 /lib/mongrel/handlers.rb
parent8287106809a82ccd1afba674740486946509b856 (diff)
downloadunicorn-f4a5c938d461d9c5dc17f521c9efaaf352b931fa.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@121 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'lib/mongrel/handlers.rb')
-rw-r--r--lib/mongrel/handlers.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/mongrel/handlers.rb b/lib/mongrel/handlers.rb
index 609a252..7d817bb 100644
--- a/lib/mongrel/handlers.rb
+++ b/lib/mongrel/handlers.rb
@@ -5,9 +5,32 @@ module Mongrel
   # just the minimum necessary for you to handle a request and shoot back
   # a response.  Look at the HttpRequest and HttpResponse objects for how
   # to use them.
+  #
+  # This is used for very simple handlers that don't require much to operate.
+  # More extensive plugins or those you intend to distribute as GemPlugins
+  # should be implemented using the HttpHandlerPlugin mixin.
+  #
   class HttpHandler
+
+    def process(request, response)
+    end
+  end
+
+
+  # This is used when your handler is implemented as a GemPlugin.
+  # The plugin always takes an options hash which you can modify
+  # and then access later.  They are stored by default for
+  # the process method later.
+  module HttpHandlerPlugin
+    attr_reader :options
+
+    def initialize(options={})
+      @options = options
+    end
+
     def process(request, response)
     end
+
   end