From: "David A. Black" Date: 2008-03-25T23:40:05+09:00 Subject: Re: hash of arrays - appending to one of the arrays --1926193751-477283966-1206456009=:29004 Content-Type: MULTIPART/MIXED; BOUNDARY="1926193751-477283966-1206456009=:29004" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1926193751-477283966-1206456009=:29004 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Tue, 25 Mar 2008, Jes=FAs Gabriel y Gal=E1n wrote: > On Tue, Mar 25, 2008 at 1:41 PM, Adam Akhtar wr= ote: >> >> > The most common idiom is: >> > >> > (hash[key] ||=3D []) << value >> > >> >> Thanks for the reply. Can I ask what these || mean..in this case do the= y >> mean OR??? > > a ||=3D b means a =3D a || b Almost, but this: a or a =3D b covers the edge cases better. David --=20 Rails training from David A. Black and Ruby Power and Light: ADVANCING WITH RAILS April 14-17 New York City INTRO TO RAILS June 9-12 Berlin ADVANCING WITH RAILS June 16-19 Berlin See http://www.rubypal.com for details and updates! --1926193751-477283966-1206456009=:29004-- --1926193751-477283966-1206456009=:29004--