rubydocs/app

Important private instance methods not included in docs

cryptogopher opened this issue · 3 comments

Rubydocs seem to omit private instance methods. For example I'm unable to find commonly used Module#included method in Ruby docs (whereas it's available e.g. here: https://ruby-doc.org/core-2.3.8/Module.html#method-i-included)

Any chance to have private instance methods documentation added?

Hi @cryptogopher, RubyDocs uses sdoc to generate the docs.
Maybe there's an option when calling sdoc to include/exclude private instance methods?
I don't have time to look into this but I'll happily accept a PR! :)

Also check: #11 (comment)
Maybe the method you're looking for is marked as nodoc?

I just tracked it down to the --all option of sdoc.

sdoc --all -D -o ../public/html/ ruby/object.c
...
Module#include?
Module#included
Module#included_modules
...
Classes:      7 (0 undocumented)
Modules:      1 (0 undocumented)
Constants:    3 (0 undocumented)
Attributes:   0 (0 undocumented)
Methods:    123 (3 undocumented)

Total:      134 (3 undocumented)


sdoc -D -o ../public/html/ ruby/object.c
...
Module#include?
Module#included_modules
...
Classes:      7 (0 undocumented)
Modules:      1 (0 undocumented)
Constants:    3 (0 undocumented)
Attributes:   0 (0 undocumented)
Methods:    108 (2 undocumented)

Total:      119 (2 undocumented)

Option --all is a synonym to --visibility=private:

sdoc --help
...
    -a, --all                        Synonym for --visibility=private.

Will provide PR shortly.

PR merged, thanks a lot! 👍

The docs for all Ruby versions will now be regenerated with the new option, one after the other. Unfortunately this will take a few days...