From: Justin Collins Date: 2007-01-16T12:49:58+09:00 Subject: Re: Finding the super class of an object? Aaron Smith wrote: > How can I find out what the super class is of an object, Say if a class > extends Hash. I need to be able to find a string representation of the > super class ('Hash').... is_a? won't work as that requires an actual > module or class.. I need a string representation. > > any ideas? thanks. Will Module#ancestors work? irb(main):001:0> class A irb(main):002:1> end => nil irb(main):003:0> class B < A irb(main):004:1> end => nil irb(main):005:0> A.ancestors => [A, Object, Kernel] irb(main):006:0> B.ancestors => [B, A, Object, Kernel] -Justin