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

Update line_width.rb (in manual) #1320

Closed
wants to merge 4 commits into from

Conversation

PhilippePerret
Copy link

For consistency (use of function rather than defining variable)

For consistency (use of function rather than defining variable)
Suppression espace ex
Change test hash to reflect changes
@pointlessone
Copy link
Member

Thank you for your contribution but I'm not sure what is the purpose of this change.

Feel free to reopen with a clarification.

@PhilippePerret
Copy link
Author

Hi Alexander,
As mentioned earlier, I made this code modification in the manual for the sake of consistency. In the example, it employs variable-based definition, which necessitates the use of:

self.<variable> = <value>

whereas in all other instances across the codebase, a function with the same name as the variable is utilized, allowing for a simpler form like:

<variable>(<value>)

# or without parentheses, as is common in DSL: 

<variable> <value>

I apologize if this modification does not seem relevant to you.

@pointlessone
Copy link
Member

Right, I see now. This manual section doesn't mention the regular DSL-style API, though. It only points out the distinction between attribute assignment and local variable assignment as it's a common gotcha.

@PhilippePerret
Copy link
Author

This manual section doesn't mention the regular DSL-style API, though. It only points out the distinction between attribute assignment and local variable assignment as it's a common gotcha.

I agree.

But the manual is a whole, isn't it? And I find that it creates confusion to always have the use of one method throughout the manual, and then suddenly switch to using the explicit definition of a variable... The subject of the section is not "you can also define attribute by assignment", it's "the line width".
I had to look into the code to understand why the logic was changing all of a sudden.
It's not consistent.

But again, if you don't find it relevant, no problem.

Have fun!

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

Successfully merging this pull request may close these issues.

2 participants