From: John Johnson Date: 2006-08-20T15:54:03+09:00 Subject: Re: Defining a method []= On Sun, 20 Aug 2006 02:40:27 -0400, Brett Kushner wrote: > I have used a method of [] with "def method[](string)". But I can't > figure out how to use[]=. > > An array works with []= such as array['string1'] = 'string2' so how > would I write a method like that for my own class? > > def method[]=(index, value) ... end Regards, JJ -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/