In ruby, defining class methods after a "private" line does not work, it only works for instance methods. Marking class methods as private is a bit more complex and there are several possible syntaxes, see:
http://stackoverflow.com/questions/4952980/creating-private-class-method
I've opted for declaring each class method as private by adding a "private_class_method :foo" line immediately after each method. It's a bit wordy but it's the most easily maintainable option. The syntax involving reopening class << self is awful, btw.
This commits includes in the change several classes that the original submitter (@yogodoshi) missed. Also added a big comment in each class at the point where private class methods begin; the comment is completely ignored by ruby, but makes the code easier to read.
↧