lib/divining_rod/definition.rb in divining_rod-0.5.0 vs lib/divining_rod/definition.rb in divining_rod-0.6.0

- old
+ new

@@ -1,15 +1,13 @@ module DiviningRod class Definition - include Murge attr_accessor :prc, :group, :opts, :parent - attr_writer :children def initialize(opts={}, &blk) @prc = blk - @opts = opts + @opts = Mash.new(opts) end def evaluate(request) result = nil child_result = nil @@ -24,30 +22,18 @@ end child_result || result end def tags - opts[:tags] || [] + @tags ||= opts[:tags] || [] end - - def opts - if parent - @murged_opts ||= murge(parent.opts, @opts) - else - @opts - end + + def children + @children ||= [] end - + def format opts[:format] - end - - def children - @children ||= [] - @children.each do |child| - child.parent ||= self - end - @children end end end