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

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -