If you don't mind removing duplicates, Sets are non-ordered, so you
could do
s = Set.new
@all.each do |e| s.add(e) end

That will be non-ordered, but duplicates will get stripped.

Tom