From: Rob Biedenharn Date: 2010-01-20T11:09:18+09:00 Subject: Re: Looking for object.inherits?(Classname) On Jan 19, 2010, at 8:53 PM, David A. Black wrote: > On Wed, 20 Jan 2010, Xeno Campanoli wrote: > >> Xeno Campanoli wrote: >> >> Looks like the method I use is "ancestors". > > Whoops, that means I misunderstood. Sorry. > > > David > > -- > David A. Black > Senior Developer, Cyrus Innovation Inc. > THE COMPLEAT RUBYIST, Ruby training with Black/Brown/McAnally! > January 22-23, Tampa, Florida > Info and registration at http://www.thecompleatrubyist.com > irb> string="string" => "string" irb> string.class => String irb> string.class.ancestors => [String, Enumerable, Comparable, Object, Kernel] irb> string.is_a?(String) => true irb> string.is_a?(Comparable) => true irb> string.kind_of?(Kernel) => true It depends on whether you have an instance of the class or the class object itself. Xeno said that he had an object. I think David understood perfectly and his answer is exactly what you want. -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com