From: Wes Gamble Date: 2006-07-13T02:46:13+09:00 Subject: Re: Determining a class's ancestor easily without instances Joel VanderWerf wrote: > Wes Gamble wrote: >> Given two classes A and B, I know that I can loop through the >> superclasses of A to determine it it's a descendant of B. >> >> Is there a more expedient way to do this - something like "is_a?" but at >> the class level (since is_a? is for objects)? > > if A < B > ### > end > > if A <= B > ### > end > > [A, B].sort So is "<" the "superclass" assignment operator? Is it a method? Seems like it operates differently in two contexts. It assigns in a class declaration, but evaluates in a logical expression? Am I understanding correctly? Wes -- Posted via http://www.ruby-forum.com/.