From: dblack@... Date: 2007-01-26T09:22:38+09:00 Subject: Re: Ruby language question ---2049402039-1726411110-1169770956=:24160 Content-Type: MULTIPART/MIXED; BOUNDARY="-2049402039-1726411110-1169770956=:24160" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---2049402039-1726411110-1169770956=:24160 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Fri, 26 Jan 2007, Neville Franks wrote: > Stefano Crocco wrote: >> Alle 01:02, venerd=C3=AC 26 gennaio 2007, Neville Franks ha scritto: >>> end >>> end >>> >>> None of the reference material I've found so far shows this. I saw it i= n >>> the documentation for: attr(symbol, writable=3Dfalse) =3D> nil >>> >>> Thanks, >>> Neville >> >> def size=3D(val) is simply the definition of a method called size=3D, wh= ich >> 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=3D2 >> >> 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=3D in a Class Viewer o= r > just size ? You wouldn't see size=3D listed as size; size and size=3D are different methods. The =3D is part of the method name. David --=20 Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com) ---2049402039-1726411110-1169770956=:24160-- ---2049402039-1726411110-1169770956=:24160--