Sha256: f18fe296265b7b289317d83d6b8c9e97910e18112f3f2dd9500ef108a737c906

Contents?: true

Size: 586 Bytes

Versions: 6

Compression:

Stored size: 586 Bytes

Contents

module YARD::CodeObjects
  # Represents a Ruby module.
  class ModuleObject < NamespaceObject
    # Returns the inheritance tree of mixins.
    # 
    # @param [Boolean] include_mods if true, will include mixed in
    #   modules (which is likely what is wanted).
    # @return [Array<NamespaceObject>] a list of namespace objects
    def inheritance_tree(include_mods = false)
      return [self] unless include_mods
      [self] + mixins(:instance).map do |m|
        next m unless m.respond_to?(:inheritance_tree)
        m.inheritance_tree(true)
      end.flatten
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
yard-0.5.3 lib/yard/code_objects/module_object.rb
yard-0.5.2 lib/yard/code_objects/module_object.rb
yard-0.5.1p1 lib/yard/code_objects/module_object.rb
yard-0.5.1 lib/yard/code_objects/module_object.rb
yard-0.5.0 lib/yard/code_objects/module_object.rb
yard-0.4.0 lib/yard/code_objects/module_object.rb