aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGibheer <gibheer@gmail.com>2012-11-26 21:38:49 +0100
committerGibheer <gibheer@gmail.com>2012-11-26 21:38:49 +0100
commit77a2cbe6d4e8752a9450e945724522d10cfb5f09 (patch)
tree28f1259b6097758fa8e97bd7dbdf9c948041235c /lib
parent06e0dc22e126b30e1a02b53b7f8228274ac5e407 (diff)
a small fix to make the controller useable
This is just to use the controller for a demonstration on where this all is heading to.
Diffstat (limited to 'lib')
-rw-r--r--lib/zero/controller.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/zero/controller.rb b/lib/zero/controller.rb
index 6d7f8e5..8469a09 100644
--- a/lib/zero/controller.rb
+++ b/lib/zero/controller.rb
@@ -10,6 +10,21 @@ module Zero
new(Zero::Request.new(env)).response
end
+ # set the renderer to use in the controller
+ def self.renderer=(renderer)
+ @@renderer = renderer
+ end
+
+ # get the renderer set in the controller
+ def self.renderer
+ @@renderer
+ end
+
+ # a small helper to get the actual renderer
+ def renderer
+ self.class.renderer
+ end
+
# initialize the controller
# @param request [Request] a request object
def initialize(request)