Inconsistent use of private attr_acessor vs. direct ivar access #1

Closed
ryanlecompte opened this Issue Jan 18, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@ryanlecompte

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.

@practicingruby

This comment has been minimized.

Show comment
Hide comment
@practicingruby

practicingruby Jan 18, 2012

Member

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.

Member

practicingruby commented Jan 18, 2012

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.

@practicingruby

This comment has been minimized.

Show comment
Hide comment
Member

practicingruby commented Jan 25, 2012

Closed by 63a1ef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment