diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-16 14:31:39 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-16 14:31:39 +0100 |
commit | f1f5d251bbabedf4a7e96a27c099a789762c6bea (patch) | |
tree | b4fcda69d4efa408aa63da0ff750dfc19d2504bb /lib | |
parent | abdcb2de223214b10e84e4e69d67dc87e5b60aec (diff) | |
download | zorglub-f1f5d251bbabedf4a7e96a27c099a789762c6bea.zip zorglub-f1f5d251bbabedf4a7e96a27c099a789762c6bea.tar.gz |
Node: set static!
Diffstat (limited to 'lib')
-rw-r--r-- | lib/zorglub/node.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb index a9e4874..980398d 100644 --- a/lib/zorglub/node.rb +++ b/lib/zorglub/node.rb @@ -13,7 +13,7 @@ module Zorglub # class << self # - attr_reader :hooks, :inherited_vars, :layout, :engine + attr_reader :hooks, :inherited_vars, :layout, :engine, :static # def inherited sub sub.layout! layout||(self==Zorglub::Node ? Config.layout : nil ) @@ -34,9 +34,9 @@ module Zorglub @layout = layout end # - def static val=nil + def static! val @static = val if (val==true or val==false) - @static ||=false + @static ||= false end # def inherited_var sym, *args @@ -207,8 +207,12 @@ module Zorglub File.join(Config.layout_base_path, @options[:layout])+ext end # - def static val=nil + def static! val @options[:static] = val if (val==true or val==false) + @options[:static] ||= false + end + # + def static return nil if not @options[:static] or @options[:view].nil? File.join(Config.static_base_path, @options[:view])+ext end |