Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Inconsistent use of private attr_acessor vs. direct ivar access #1
Currently private attr_accessors are not used for all classes. In some classes instance variables are referenced directly, and in other cases attr_accessor definitions are used.
In the next article, it would be interesting to discuss the benefits/advantages/reasoning behind defining private attr_accessor vs. direct instance variable access.
Good idea, and I agree, these should be consistent. I'll patch it myself this weekend if someone else doesn't beat me to it. I hinted at why I use private accessors in a previous Practicing Ruby article, but I ran into some oddities with them in this particular use case. I'll mention those in Issue 3.4 if there aren't much more pressing issues to focus on.