3 ms·
attr_reader defines reader methods that just return the ivar with the same name. They are just syntactic sugar, and sometimes it makes sense to put them after t
by eloisius 2y ago
attr_reader defines reader methods that just return the ivar with the same name. They are just syntactic sugar, and sometimes it makes sense to put them after the private keyword, and private methods are idiomatically at the “bottom” of the class.
- rezonant 2y agoBy the way, this is perhaps my biggest problem with Ruby. It is far too easy to have a lot of private methods and to lose sight of the fact that you're in the private section.
- deleted 2y ago[deleted]