ruby source code

I

isaiah perumalla

Hey all how do i view the source code for ruby kernel classes like
Object and Class.
For example say i would like to see how the method #new implemented ?
is this implemented in Ruby or do i have to step into the C source
code ?

Thanks
Isaiah
 
T

Tim Hunter

isaiah said:
Hey all how do i view the source code for ruby kernel classes like
Object and Class.
For example say i would like to see how the method #new implemented ?
is this implemented in Ruby or do i have to step into the C source
code ?

Thanks
Isaiah

The core classes (like Object and Class) are implemented in C. Usually
the class name matches the source file name. That is, Class => class.c.
 
S

Sebastian Hungerecker

Am Sonntag 12 Juli 2009 23:15:08 schrieb isaiah perumalla:
Hey all how do i view the source code for ruby kernel classes like
Object and Class.

You can see a method's source code by clicking its name in the rdoc. Or you
could download the ruby source code from ruby-lang.org's download section.

For example say i would like to see how the method #new implemented ?
http://ruby-doc.org/core/classes/Class.src/M002787.html

is this implemented in Ruby or do i have to step into the C source
code ?

It's in C.
Thanks
Isaiah

HTH,
Sebastian
 

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
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top