Project

General

Profile

Actions

Bug #1640

closed

[PATCH] Documentation for the Rational Class

Added by runpaint (Run Paint Run Run) almost 15 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.2dev (2009-06-14 trunk 23691) [i686-linux]
Backport:
[ruby-core:23869]

Description

=begin
The Rational class has no documentation, so I've attached a first draft. Some comments:

  • The class was defined with a constant name which caused the Rdoc C parser to ignore it. I've changed the constant to a literal string, but I assume there's a better approach.
  • Some of the commented-out methods confused Rdoc. For instance, Rational#div had a commented-out alias of '//', which Rdoc displays. I didn't want to delete the commented-out code, so I'm not sure what to do about this. (I can't use :nodoc: for the function because it is used as #div).
  • I didn't document the #marshal_* methods because other classes don't. Is this correct?
  • I haven't documented the optional precision argument that some of the methods have because I wasn't sure I understood the algorithm enough to explain it. Any suggestions?
  • The #coerce documentation assumes that bug #1636 will be fixed.
    =end

Files

rational.c-documentation.patch (26.3 KB) rational.c-documentation.patch runpaint (Run Paint Run Run), 06/16/2009 11:14 AM
rational.c-documentation.patch (25 KB) rational.c-documentation.patch runpaint (Run Paint Run Run), 06/18/2009 01:14 AM
rational.c-documentation.patch (27.5 KB) rational.c-documentation.patch runpaint (Run Paint Run Run), 06/18/2009 10:11 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0