Quick question: Iterate through a collection - no duplicates

Hi, is there a simple way to iterate through collection and not include
duplicates?

Thanks in advance.

Jordan

On 7/4/06, Jordan I. [email protected] wrote:

Hi, is there a simple way to iterate through collection and not include
duplicates?

@my_collection.uniq.each do |thing|
stuff
end

Thanks in advance.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs