Does ruby provide a method to show the hierarchy calls? -


All this, I want to see what all things are inherited to a certain class.

Thanks

Div class = "post-text" itemprop = "text" >

Are you saying to see all the ancestors of a class, or lineage? For ancestors, use it:

  class.worker  

There is no comparable way "out of the box" for the descendants, however, Space can be used as below, but it is slow and can not be portable in the implementation of Ruby:

  ObjectSpace.each_object (class) do | Klass | P class if class & lt; Standard entry end  

Edit:

Any tracking can also be used to track sub-closing This tracking Will not catch any subclasses created before defining the functionality, however, your use case may not be fit. If you have to use that information program on the classes defined in your application, however, this may be the way to go.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -