Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
Copy link

ryanlecompte commented Jan 18, 2012

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.

Copy link
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.

Copy link
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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.