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

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

visual studio - Deleting lines of code in a text editor -

What's the encoding type of Android 2.2 push message? -