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

Allow prefixing memoized variables with underscores #5981

Conversation

teoljungberg
Copy link

A convention to avoid instance variables leaking private details out of
their current scope is to prefix the memoized variable with an
underscore. This is commonly used in objects that exposes its values
using instance variables, i.e in how a Rails controller communicates
with its corresponding view.

This commit allows prefixing memoized instance variables to use this
syntax and not generate any warnings.

A convention to avoid instance variables leaking private details out of
their current scope is to prefix the memoized variable with an
underscore. This is commonly used in objects that exposes its values
using instance variables, i.e in how a Rails controller communicates
with its corresponding view.

This commit allows prefixing memoized instance variables to use this
syntax and not generate any warnings.
@Drenmi
Copy link
Collaborator

Drenmi commented Jun 9, 2018

Thanks @teoljungberg. It looks like #5844 might offer the same functionality. Could you have a look?

@teoljungberg
Copy link
Author

You are absolutely right, I forgot to look at existing PRs and issues before opening mine.

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants