lib/jumoku/builders/arborescence.rb
# Return the parent node of another.
#
# @param [Node] node
# @raise if the node has more than one parent (should never occur!)
# @return [Node, nil] nil if the node is root
#
Return the parent node of another.
Return the parent node of another .
def parent(node)
      parent = adjacent(node, :direction => :in)
      raise JumokuError, "Inconsistent directed tree (more than one parent for the node!)" if parent.size > 1
      parent.empty? ? nil : parent.first
    end
def parent ( node ) parent = adjacent ( node , :direction => :in ) raise JumokuError , "Inconsistent directed tree (more than one parent for the node!)" if parent . size > 1 parent . empty? ? nil : parent . first end
Return the parent node of another.
Return the parent node of another .
nil if the node is root
nil if the node is root
Node, nil
if the node has more than one parent (should never occur!)
if the node has more than one parent ( should never occur! )
node
<not_specific>
<not_specific>
None