What is the RDoc on File talking about?

  • Thread starter Oliver Saunders
  • Start date
O

Oliver Saunders

Because right now RDoc puts all File related stuff together, from all
files that modify the class.

Ahh OK.

I can see it lists the files the RDoc was generated from as "In:" but is
it possible to tell which methods come from where? I'd like to know
which I can use without requiring anything.
 
P

Phillip Gawlowski

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Oliver Saunders wrote:
|> Because right now RDoc puts all File related stuff together, from all
|> files that modify the class.
|
| Ahh OK.
|
| I can see it lists the files the RDoc was generated from as "In:" but is
| it possible to tell which methods come from where? I'd like to know
| which I can use without requiring anything.

Not in an easy way (you could compare the methods the requiring adds,
though).

The easy way of knowing what methods are at your disposal at any given
time, is #methods with its pal #sort. This is inherited from Object
(IIRC), and you can always uses those to a) find out what methods are
available, and b) sort the output.

This is especially useful in irb.

- -- Phillip Gawlowski
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkfylVgACgkQbtAgaoJTgL/DuQCghvUVEjCMQ0s6wnQyV/YOVXKj
0BUAn1Uol2e+LABVZH24wYxG3vu3Hui+
=3DZJ
-----END PGP SIGNATURE-----
 
C

Christopher Dicely

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Oliver Saunders wrote:
|> Because right now RDoc puts all File related stuff together, from all
|> files that modify the class.
|
| Ahh OK.
|
| I can see it lists the files the RDoc was generated from as "In:" but is
| it possible to tell which methods come from where? I'd like to know
| which I can use without requiring anything.

Not in an easy way (you could compare the methods the requiring adds,
though).

The easy way of knowing what methods are at your disposal at any given
time, is #methods with its pal #sort. This is inherited from Object
(IIRC), and you can always uses those to a) find out what methods are
available, and b) sort the output.

This is especially useful in irb.

True. Personally, using IRB, I'm fond of the construction:
puts (foo.methods - Kernel.methods).sort.join("\t")
 

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
474,289
Messages
2,571,435
Members
48,121
Latest member
ColinHibne

Latest Threads

Top