Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up
I don't agree with the preference expressed in the guide, but I think I understand the issue. Consider this Ruby code:
As far as I know, that's the only way to support usage like this:
I mean, using a class variable would cause it to be shared by
AandB, which we don't want.Does that sound right to you? Is there another way to implement that snippet above?
I think the same thing is true for
alias, it only works for class methods insideclass << self.So, I don't agree with the preference, but I think that explains the difference, does that make sense?
Originally posted by @rmosolgo in #7 (comment)