Test whether a Ruby class is a subclass of another class
I would like to test whether a class inherits from another class, but there doesn’t seem to exist a method for that. class A end class B < A end B.is_a? A => false B.superclass == A => true A trivial implementation of what I want would be: class Class def is_subclass_of?(clazz) return true if … Read more