add_class(class_type, given_name, superclass = '::Object') public

Adds a class named given_name with superclass.

Both given_name and superclass may contain ‘::’, and are interpreted relative to the self context. This allows handling correctly examples like these:

class RDoc::Gauntlet < Gauntlet
module Mod
  class Object   # implies < ::Object
  class SubObject < Object  # this is _not_ ::Object

Given class Container::Item RDoc assumes Container is a module unless it later sees class Container. add_class automatically upgrades given_name to a class in this case.

Show source
Register or log in to add new notes.