summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-01-16 14:05:05 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-01-16 14:05:05 +0100
commita9e7b5c1710c5dc5d9f91c4990e0cfa3beee3174 (patch)
tree8a0f0cb4713bc64c3714318a904c9de7b821817e /lib
parent9d964f953f9aedf9362841207683ad0a47e88f30 (diff)
downloadzorglub-a9e7b5c1710c5dc5d9f91c4990e0cfa3beee3174.zip
zorglub-a9e7b5c1710c5dc5d9f91c4990e0cfa3beee3174.tar.gz
Node: remove layout! parameter checks
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