From: Austin Ziegler Date: 2002-12-01T23:41:29+09:00 Subject: Re: Ruby Document On Sun, 1 Dec 2002 05:27:58 +0900, Shannon Fang wrote: > And in ruby, attr_reader :name, and def name... end, while in > Delphi, it is "property name". Again delphi is easier to > comprehend, and hence harder to forget. Of course, when you know > the meaning of attr_reader it is as simple as "property", but for > beginer, like me, who knows oop, but new to ruby, it doesn't make > sense at the beginning. Shannon, Note that: class Foo attr_reader :bar end is only the same as: Type Foo = Class Property bar: Variant Read getBar; End; For a read/write "property", you need: class Foo attr_accessor :bar end Both attr_reader and attr_accessor are methods which produce syntax sugar. It is no different than doing: class Foo def bar; @bar; end def bar=(b); @bar = b; end end Considering the attr_* methods to be the same as Property values in Delphi (or C#) is, IMO, a mistake. -austin -- Austin Ziegler, austin@halostatue.ca on 2002.12.01 at 09.34.18