Re:Ask YC: What exactly is so hard about OO?
by stcredzero on Tuesday June 03, 2008 @11:29AM
(#207973)
I'm not 100% sure, but attr_reader looks like it's actually a message send. If it's not, then it could be implemented that way.
[ Parent
| on HN ]
Re:Ask YC: What exactly is so hard about OO?
by LogicHoleFlaw on Tuesday June 03, 2008 @12:24PM
(#208041)
Yes, it is a plain old method being executed in the context of the current class. It creates new class methods which can be used to read, but not write, instance variables.
There are methods to create read-write and (I think? write-only) properties as well.