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 Attribute Summary

Attributes inherited from NamespaceObject

#aliases, #attributes, #children, #class_mixins, #groups, #instance_mixins

Attributes inherited from Base

#base_docstring, #dynamic, #files, #group, #namespace, #signature, #source, #source_type, #visibility

Instance Method Summary collapse

Methods inherited from NamespaceObject

#child, #class_attributes, #constants, #cvars, #included_constants, #included_meths, #initialize, #instance_attributes, #meths, #mixins

Methods inherited from Base

===, #[], #[]=, #add_file, #add_tag, #copy_to, #docstring, #docstring=, #dynamic?, #equal?, #file, #format, #has_tag?, #hash, #initialize, #inspect, #line, #method_missing, #name, new, #path, #relative_path, #root?, #sep, #tag, #tags, #title, #to_ary, #type

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:



12
13
14
15
16
17
18
19
# File 'lib/yard/code_objects/module_object.rb', line 12

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