Get class and superclass : superclass « Reflection « Ruby

Get class and superclass

o = "test"  # This is a value
o.class     # Returns an object representing the String class
o.class.superclass            # Object: superclass of String is Object
o.class.superclass.superclass # nil: Object has no superclass


Related examples in the same category

1.Get superclass
2.Object has a super class in Ruby 1.9