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

Issue 3706 #3722

Merged
merged 2 commits into from Dec 4, 2020
Merged

Issue 3706 #3722

merged 2 commits into from Dec 4, 2020

Conversation

MorayJ
Copy link
Contributor

@MorayJ MorayJ commented Dec 3, 2020

The problem

OO code example in rb-nutshell doesn't work #3706

Code snippet example "is bogus code in several ways, generating warnings, failing to initialize the object, etc."

Solution provided

The snippet uses BUILD to access properties at instantiation, but they don't yet exist. TWEAK must be used as it runs after the properties are set.

For clarity, have removed private attributes from this example as they are not referred to.

Code example now works using TWEAK instead of BUILD.

Changes description to mentions TWEAK instead of BUILD too.
There is no reason in this example to show a private attribute.

This clarifies that TWEAK can use $! to access attributes and
that it's not a typo, without going into an explanation at
this stage.
Copy link
Contributor

@JJ JJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@JJ JJ merged commit 8041a64 into master Dec 4, 2020
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.

None yet

2 participants