From a59f33f9b69e8363944eaac0e99913993a9ab9b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 3 Jan 2012 15:28:31 +0100 Subject: node: implement layout/engine inheritance --- lib/zorglub/node.rb | 13 +++++++++---- 1 file 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 # -- cgit v1.1-2-g2b99