superclass

class.superclass รข a_super_class or nil
Instance Public methods

Returns the superclass of class, or nil.

File.superclass          #=> IO
IO.superclass            #=> Object
Object.superclass        #=> BasicObject
class Foo; end
class Bar < Foo; end
Bar.superclass           #=> Foo

returns nil when the given class hasn't a parent class:

BasicObject.superclass   #=> nil
doc_ruby_on_rails
2015-04-01 07:07:44
Comments
Leave a Comment

Please login to continue.