From: Neville Franks Date: 2007-01-26T09:17:06+09:00 Subject: Re: Ruby language question Stefano Crocco wrote: > Alle 01:02, venerd狸 26 gennaio 2007, Neville Franks ha scritto: >> end >> end >> >> None of the reference material I've found so far shows this. I saw it in >> the documentation for: attr(symbol, writable=false) => nil >> >> Thanks, >> Neville > > def size=(val) is simply the definition of a method called size=, which > accepts the parameter val. It's the ruby way of allowing write access to > an > instance variable. Its role is similar to C++ setter functions. When you > write > > an_object.var=2 > > I hope this answers your question. > > Stefano Stefano, thanks that makes sense. I guess it is a more like operator overloading in C++, maybe! Would you expect to see the method listed as: size= in a Class Viewer or just size ? -- Posted via http://www.ruby-forum.com/.