From: Jeff Wood Date: 2005-11-23T10:06:40+09:00 Subject: Re: what is the ruby way to do this? ------=_Part_706_870493.1132707994813 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline It's defining the << operator on the @attributes object j. On 11/22/05, ako... wrote: > > > @attributes =3D {} > > > > # Assumes the given object quacks on 'key' > > def @attributes.<<( keyed_obj ) > > (self[keyed_obj.key]||=3D[])< > end > > > > @attributes << a1 > > @attributes << a2 > > @attributes << a3 > > this is something i have never seen. would you explain the 'def' line > above? is this the same as class << @attributes; def << ...; end ? > > > -- "Remember. Understand. Believe. Yield! -> http://ruby-lang.org" Jeff Wood ------=_Part_706_870493.1132707994813--