summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/zorglub/node.rb28
1 files changed, 17 insertions, 11 deletions
diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb
index 9974a20..5ebebc2 100644
--- a/lib/zorglub/node.rb
+++ b/lib/zorglub/node.rb
@@ -13,10 +13,10 @@ module Zorglub
#
class << self
#
- attr_reader :hooks, :inherited_vars
+ attr_reader :hooks, :inherited_vars, :layout
#
def inherited sub
- sub.layout layout
+ sub.layout! layout||(self==Zorglub::Node ? Config.layout : nil )
sub.engine engine
sub.instance_variable_set :@inherited_vars, {}
@inherited_vars.each do |s,v| sub.inherited_var s, *v end
@@ -27,9 +27,12 @@ module Zorglub
@engine ||= Config.engine
end
#
- def layout layout=nil
- @layout = layout unless layout.nil? or layout.empty?
- @layout ||= Config.layout
+ def no_layout!
+ @layout = nil
+ end
+ #
+ def layout! layout
+ @layout = layout
end
#
def static val=nil
@@ -189,14 +192,17 @@ module Zorglub
@options[:engine]
end
#
- def layout layout=nil
- @options[:layout] = layout unless layout.nil? or layout.empty?
- return '' if @options[:layout].nil?
- File.join(Config.layout_base_path, @options[:layout])+ext
+ def no_layout!
+ @options[:layout] = nil
end
#
- def no_layout
- @options[:layout] = nil
+ def layout! layout
+ @options[:layout] = layout
+ end
+ #
+ def layout
+ return '' if @options[:layout].nil?
+ File.join(Config.layout_base_path, @options[:layout])+ext
end
#
def static val=nil