ruby on rails - How can I know whether a class is inherited from another one? Some methods like is_a? -
simple example:
class end class b < end
then, how can judge whether class b inherited class a? there method somehow is_a?
or maybe called is_child_of?
?
i can't find one.
you can use <
operator:
b < a
true, if b subclass of a.
Comments
Post a Comment