Newbie question on RDoc--top-level functions

  • Thread starter Kenneth McDonald
  • Start date
K

Kenneth McDonald

How do I get a top-level function (one not defined inside a class) to
show up in RDoc output. I have a number of such functions, and they
don't appear to be showing up anywhere.

Thanks,
Ken
 
T

Trans

How do I get a top-level function (one not defined inside a class) to =A0
show up in RDoc output. I have a number of such functions, and they =A0
don't appear to be showing up anywhere.

Not really a good practice in any case.

You can just move them to Object, which is effectively the same
(except public vs. private):

class Object
# ... methods here
end

If you consider them general purpose core extensions then Kernel may
be more appropriate:

module Kernel
# ... methods here
end

T.
 
R

Ryan Davis

How do I get a top-level function (one not defined inside a class)
to show up in RDoc output. I have a number of such functions, and
they don't appear to be showing up anywhere.


global methods get added to Object as private methods, but rdoc
doesn't automatically file them in Object (I'm filing a bug on that).
They _do_ show up in the method list:
Public Instance methods
x()
this is my rdoc
Here I'm creating a new project, throwing a global method in the file,
and generating rdoc:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top