Class: YARD::CodeObjects::ModuleObject

Inherits:
NamespaceObject show all
Defined in:
lib/yard/code_objects/module_object.rb

Overview

Represents a Ruby module.

Direct Known Subclasses

RootObject

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from YARD::CodeObjects::NamespaceObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class YARD::CodeObjects::Base

Instance Method Details

#inheritance_tree(include_mods = false) ⇒ Array<NamespaceObject>

Returns the inheritance tree of mixins.

Parameters:

  • include_mods (Boolean) (defaults to: false)

    if true, will include mixed in modules (which is likely what is wanted).

Returns:



9
10
11
12
13
14
15
16
# File 'lib/yard/code_objects/module_object.rb', line 9

def inheritance_tree(include_mods = false)
  return [self] unless include_mods
  [self] + mixins(:instance, :class).map do |m|
    next if m == self
    next m unless m.respond_to?(:inheritance_tree)
    m.inheritance_tree(true)
  end.compact.flatten.uniq
end