summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-01-04 09:57:53 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-01-04 09:57:53 +0100
commit824de119f25fe11077c42c22ab77dd1a6d579859 (patch)
tree6bb6c2d2facbd589af58888c83f17d8b171403f7 /lib
parentcd8ab4a588c70f726d255efbb61c535869920881 (diff)
downloadzorglub-824de119f25fe11077c42c22ab77dd1a6d579859.zip
zorglub-824de119f25fe11077c42c22ab77dd1a6d579859.tar.gz
Node: add Node#state and use it
Diffstat (limited to 'lib')
-rw-r--r--lib/zorglub/node.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb
index aed6376..5eb2b85 100644
--- a/lib/zorglub/node.rb
+++ b/lib/zorglub/node.rb
@@ -116,12 +116,13 @@ module Zorglub
#
def feed!
Node.call_before_hooks self
+ state :meth
@content = self.send @action[:method], *@action[:args]
e, v, l = Config.engine_proc(@action[:engine]), view, layout
# TODO compile and cache
- @action[:mode]=:view
+ state :view
@content = e.call v, self if e and File.exists? v
- @action[:mode]=:layout
+ state :layout
@content = e.call l, self if e and File.exists? l
Node.call_after_hooks self
@content
@@ -138,6 +139,11 @@ module Zorglub
"You are being redirected, please follow this link to: <a href='#{target}'>#{target}</a>!"
end
#
+ def state state=nil
+ @action[:state] = state unless state.nil?
+ @action[:state]
+ end
+ #
def engine engine=nil
@action[:engine] = engine unless engine.nil? or engine.empty?
@action[:engine]