Class | TTK::Strategies::Collection |
In: |
lib/ttk/strategies/Collection.rb
|
Parent: | Composite |
# File lib/ttk/strategies/Collection.rb, line 15 def initialize ( *a, &b ) @attributes = OHash.new super end
Create a new test, using the current loader, and add it to the collection.
# File lib/ttk/strategies/Collection.rb, line 23 def create ( anObject, &block ) super do |t| @log.log_debug{"assign collection attributes #{@attributes.size}"} @attributes.each do |k,v| @log.log_debug{"assign attribute: #{k}"} next if k == :contents t.assign_one(k, v, true) end if @attributes.has_key? :contents t.assign_one(:contents, @attributes[:contents], true) end block[t] if block_given? @attributes.each do |k,v| t.reject k if t.respond_to? k and t.send(k) == v end end end
# File lib/ttk/strategies/Collection.rb, line 102 def strategyclass= ( aClass ) @attributes[:strategy] = aClass end