diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-03 15:28:31 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-03 15:28:31 +0100 |
commit | a59f33f9b69e8363944eaac0e99913993a9ab9b0 (patch) | |
tree | 766d29420dfce312a5e69a51071fb8d1cf199e0b | |
parent | bdf013ad9b1fe4603f4d3d6eef6d0e4b24d54876 (diff) | |
download | zorglub-a59f33f9b69e8363944eaac0e99913993a9ab9b0.zip zorglub-a59f33f9b69e8363944eaac0e99913993a9ab9b0.tar.gz |
node: implement layout/engine inheritance
-rw-r--r-- | lib/zorglub/node.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb index af29a86..eee5c0e 100644 --- a/lib/zorglub/node.rb +++ b/lib/zorglub/node.rb @@ -13,13 +13,18 @@ module Zorglub # attr_reader :hooks # + def inherited sub + sub.layout layout + sub.engine engine + end + # def engine engine=nil @engine = engine unless engine.nil? @engine ||= Config.engine end # - def layout name=nil - @layout = name unless name.nil? + def layout layout=nil + @layout = layout unless layout.nil? @layout ||= Config.layout end # @@ -122,8 +127,8 @@ module Zorglub @action[:engine] end # - def layout name=nil - @action[:layout] = name unless name.nil? + def layout layout=nil + @action[:layout] = layout unless layout.nil? File.join(Config.layout_base_path, @action[:layout])+'.'+ Config.engine_ext(@action[:engine]) end # |