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

Group class methods under class << self #981

Merged
merged 1 commit into from
Jul 16, 2024
Merged

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Jul 6, 2024

I think in most cases class << self makes class methods easier to identify and locate because they'd fall under the same block and have another level of indentation. I also reorganized the constants/methods under RubyLex.

lib/irb/nesting_parser.rb Outdated Show resolved Hide resolved
@st0012 st0012 force-pushed the format-class-methods branch from 8322136 to 515d67c Compare July 12, 2024 16:21
Copy link
Member

@tompng tompng left a comment

Choose a reason for hiding this comment

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

I personally like def self.f syntax, especially when a module only have singleton methods.
Eexample: IRB::NestingParser and IRB::RubyLex (RubyLex does not have a state and it can be a module).
But yes, unifying the style has huge benefit 👍

@st0012 st0012 merged commit cdaa356 into master Jul 16, 2024
59 checks passed
@st0012 st0012 deleted the format-class-methods branch July 16, 2024 15:58
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