From: Stefano Crocco Date: 2007-04-07T21:46:12+09:00 Subject: Re: class hierarchy with rdoc Alle sabato 7 aprile 2007, Googy ha scritto: > Hi, > > I am newbie to ruby, I have extensive experience in java & with > javadoc, javadoc shows class hierarchy i.e. its parent classes and > interfaces in a tree view, so you can easily understand the whole > hierarchy but when I moved to ruby the feature missing is to see the > class hierarchy for ruby classes. Every time I can't fire irb and > create an object and see its ancestors > (.class. ancestors). > > So am I missing something? Is it possible to see the class hierarchy > in rdoc generated documentation ? > > Particularly when you go to http://www.ruby-doc.org/core/ for core > documentation there is no way to see even Fixnum parent classes. > Fixnum is only for example. And from my experience good > documentation plays important role in its adaptability. > > Suggest me if there are any alternative ruby documentation generators > or class browsers. > > Thanks. RDoc doesn't allow you to see the full class hierarchy, but it does allow you to see the parent class of a given class. It's specified just below the name of the class. Taking Fixnum as an example, at the beginning of the documentation page, there is: Class Fixnum In: numeric.c lib/mathn.rb lib/rational.rb lib/rexml/xpath_parser.rb Parent: Integer This last line is the one you need. It tells you that the parent class of Fixnum is Integer. You can also see it using ri: if you type, for example: ri Fixnum, the very first line you get says: Class: Fixnum < Integer which tells you the parent of Fixnum. If no parent is displayed, it means that the class inherit directly from Object. I hope this helps Stefano