2 ms·
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.
by stcredzero 18y ago
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.
- LogicHoleFlaw 18y agoYes, 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.