class Jazzy::SymbolGraph::BaseNode

The rebuilt syntax tree is made of nodes that either match symbols or that we fabricate for extensions. This is the common treeishness.

Attributes

children[RW]
parent[RW]

Public Class Methods

new() click to toggle source
# File lib/jazzy/symbol_graph/sym_node.rb, line 12
def initialize
  self.children = []
end

Public Instance Methods

add_child(child) click to toggle source
# File lib/jazzy/symbol_graph/sym_node.rb, line 16
def add_child(child)
  child.parent = self
  children.append(child)
end
add_children_to_sourcekit(hash, module_name) click to toggle source
# File lib/jazzy/symbol_graph/sym_node.rb, line 21
def add_children_to_sourcekit(hash, module_name)
  unless children.empty?
    hash['key.substructure'] =
      children.sort.map { |c| c.to_sourcekit(module_name) }
  end
end