From: Edwin Fine Date: 2006-12-09T16:26:55+09:00 Subject: Re: Beginners question about Array#assoc Chad Thatcher wrote: > Daniel Finnie wrote: >> It might be include? (the question mark is part of the method name) >> >> An example of include?'s usage: >> irb(main):001:0> array = ["a", "b", "c"] >> => ["a", "b", "c"] >> irb(main):002:0> array.include? "a" >> => true >> irb(main):003:0> array.include? "z" >> => false > > Thing is its an array of arrays so I need to use the assoc method. > > Anyway I figured it out, the code should have read: > > if !masters.assoc(row["tag"]) > > I was being dense and coding at a quarter to 2am on a friday night is > never an advisable thing :D Or you could write unless masters.assoc(row["tag"]) This seems to be more Rubyish practice from what I've seen. -- Posted via http://www.ruby-forum.com/.