From 77a2cbe6d4e8752a9450e945724522d10cfb5f09 Mon Sep 17 00:00:00 2001 From: Gibheer Date: Mon, 26 Nov 2012 21:38:49 +0100 Subject: [PATCH] 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. --- lib/zero/controller.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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)