Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

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.


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.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: