From: Jimmy Kofler Date: 2007-11-06T22:20:19+09:00 Subject: Re: operator |= > operator |= > Posted by Fernando Cacciola (Guest) on 06.11.2007 12:59 > > Hi people, > > Did I dream about an opeartor |=? > > I can't find any reference to it in the online docs, yet I think I've seen > it in some samples. > > What does it do? |= can also be used with arrays. shopping_list = ['peanut butter', 'grape jelly', 'whole wheat bread'] shopping_list |= ['peanut butter', 'sugar'] p shopping_list #=> ['peanut butter', 'grape jelly', 'whole wheat bread', 'sugar'] (cf. http://rubysnips.com/add-to-array-if ) Cheers, j. k. -- Posted via http://www.ruby-forum.com/.