# Author:: Nicolas Desprès . # Copyright:: Copyright (c) 2004, 2005 Uttk team. All rights reserved. # License:: LGPL # $Id: /w/fey/uttk/trunk/lib/uttk/strategies/Composite/contents_eval.rb 8788 2005-09-27T14:23:19.686215Z ertai $ module Uttk module Strategies class Composite < Strategy class ContentsEval def initialize(contents=[], &block) @contents = contents if block if block.arity == -1 instance_eval(&block) else block[self] end end end attr_reader :contents def name(item_name, &block) contents << { item_name.to_s => HashEval.new(&block).hash } end end # class ContentsEval end # class Composite end # module Strategies end # module Uttk