def items=(str)
items = str.split(/\s+/).collect {|c| (/^(:|\*)(\w+)$/ =~ c) ? (($1 == ':' ) ? $2.intern : "*#{$2}".intern) : c} if str.kind_of?(String)
items.shift if items.first == ""
items.pop if items.last == ""
@items = items
if @items.first.kind_of? Symbol
raise ArgumentError, "Illegal template -- first component cannot be dynamic\n #{str.inspect}"
end
@items.inject({}) do |seen, item|
if item.kind_of? Symbol
it = item.to_s.sub(/^\*/,"").intern
raise ArgumentError, "Illegal template -- duplicate item #{it} in #{str.inspect}" if seen.key? it
seen[it] = true
end
seen
end
end