Checking for an object in a collection

Is there a quick way to to check for an object’s existence in a
collection?

Pieter M. wrote:

Is there a quick way to to check for an object’s existence in a
collection?

collection.include?(object) or collection.find(object) depending on what
collection you have, I guess.


Jakob S. - http://mentalized.net

Jakob S. wrote:

Pieter M. wrote:

Is there a quick way to to check for an object’s existence in a
collection?

collection.include?(object) or collection.find(object) depending on what
collection you have, I guess.


Jakob S. - http://mentalized.net

Thanks!

correction, find on a collection works only for id.