Irb documentation queries?

B

Benjamin J. Racine

Hello all,

I am coming from python and loving ruby (the language), but trying to figur=
e out some of the tools/capabilities.

Would anyone be so kind as to tell me whether irb has a way of seeing docum=
entation strings in the source code (as in ipython)?

Many thanks,

Ben Racine
 
B

badboy

Benjamin said:
Hello all,

I am coming from python and loving ruby (the language), but trying to figure out some of the tools/capabilities.

Would anyone be so kind as to tell me whether irb has a way of seeing documentation strings in the source code (as in ipython)?

Many thanks,

Ben Racine
type
help name
for the documentation or use
ri names
on command-line

for example:
$ ri 'Array::[]'
or
irb> help 'Array::[]'

or install fastri:
http://eigenclass.org/hiki/fastri
it's faster ;)
 
A

Albert Schlef

Benjamin said:
Would anyone be so kind as to tell me whether irb has a way of seeing
documentation strings in the source code (as in ipython)?

No, it's not possible. Although in Ruby the documentation is embedded in
the source code, it's not something the interpreter/compiler really
sees. There's an external tool you use to call up this documentation.
 

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

Forum statistics

Threads
474,183
Messages
2,570,970
Members
47,526
Latest member
RoslynDavi

Latest Threads

Top