There are at least 3 ways to define class methods in ruby, and I think that all are acceptable, but define two class methods in different ways in the standard library it's not a good example, nor a good practice and does not help in readability.
Ok, there is a lacking feature in RDoc, but I don't think that keeping it that way is the way to go.
I've tried to fix it only touching documentation, and it seems to be
impossible, rdoc does not understand the class << self syntax (I
understand rdoc in this point, ruby is not easy to parse). I've added an
issue in Rdoc for it ( https://github.com/rdoc/rdoc/issues/317 ).
So the Tempfile.open method needs to be redefined to be understand by rdoc.
I've updated the pull request with the minimal change that will fix the
issue I don't like it as it define class methods outside of the class
itself (so the source is harder to read), and it hardcode the class name
two times (that I think is ugly).
I quite not understand why there is so much resistance to refactor the code
for readability.