From: Jos Backus Date: 2011-03-03T15:18:52+09:00 Subject: Re: Anything like Array.contains? method --000e0cd70ddc9e1dd7049d8e00f0 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Mar 2, 2011 at 10:12 PM, Paul Sholtz wrote: > Is there a method in the Ruby array object that gives anything like a > "contains?" method, to test if an object is already in the Array? > > For the time being, I've extended the Array class as follows: > > http://pastie.org/1627594 > > I wondered if this was a good way, or if there was already something in > the API that allowed for this. I couldn't seem to find anything.. > > Array.include? -- Jos Backus jos at catnook.com --000e0cd70ddc9e1dd7049d8e00f0--