From: Simon Vandemoortele Date: 2003-04-27T19:32:39+09:00 Subject: Re: ASCII class inheritance tree generator On Sun, 27 Apr 2003 at 07:17 GMT, daz wrote: > classTree(Object) > # -> : undefined method `instance_methods' for nil (NoMethodError) Harry Olson caught this one too (see his solution in this thread). > classTree(Kernel) > # -> : undefined method `superclass' for Kernel:Module (NoMethodError) > Both can be supported by a one-line (?wrapped? below) update ... > methods = (current_root.instance_methods - begin > current_root.superclass.instance_methods rescue [] end).sort After adding 'NameError' behind 'rescue' this solution also works here. I have updated the code on the Wiki page. (Note that the latest version prints in color ...) Simon -- There are 10 types of people in the world... those who understand binary and those who don't.