Class | YARD::CodeObjects::ClassObject
In: | lib/yard/code_objects/class_object.rb
Parent: | NamespaceObject

A ClassObject represents a Ruby class in source code. It is a {ModuleObject} with extra inheritance semantics through the superclass.

### Methods

constants inheritance_tree inherited_constants inherited_meths is_exception? meths new superclass=

### Attributes

superclass | [R] | The {ClassObject} that this class object inherits from in Ruby source. @return [ClassObject] a class object that is the superclass of this one

### Public Class methods

new(namespace, name, *args, &block)

Creates a new class object in `namespace` with `name`

@see Base.new

### Public Instance methods

constants(opts = {})

Returns the list of constants matching the options hash.

@param [Hash] opts the options hash to match @option opts [Boolean] :inherited (true) whether inherited constant should be

      included in the list

@option opts [Boolean] :included (true) whether mixed in constant should be

      included in the list

@return [Array<ConstantObject>] the list of constant that matched

inheritance_tree(include_mods = false)

Returns the inheritance tree of the object including self.

@param [Boolean] include_mods whether or not to include mixins in the

      inheritance tree.

@return [Array<NamespaceObject>] the list of code objects that make up

      the inheritance tree.

inherited_constants()

Returns only the constants that were inherited.

@return [Array<ConstantObject>] the list of inherited constant objects

inherited_meths(opts = {})

Returns only the methods that were inherited.

@return [Array<MethodObject>] the list of inherited method objects

is_exception?()

Whether or not the class is a Ruby Exception

@return [Boolean] whether the object represents a Ruby exception

meths(opts = {})

Returns the list of methods matching the options hash. Returns all methods if hash is empty.

@param [Hash] opts the options hash to match @option opts [Boolean] :inherited (true) whether inherited methods should be

      included in the list

@option opts [Boolean] :included (true) whether mixed in methods should be

      included in the list

@return [Array<MethodObject>] the list of methods that matched

superclass=(object)

Sets the superclass of the object

@param [Base, Proxy, String, Symbol, nil] object the superclass value @return [void]

[Validate]