def ancestors
      return to_enum(__callee__) unless block_given?
      node = self
      loop do
        node = node.parent
        yield node
      end
    end
def ancestors
      return to_enum(__callee__) unless block_given?
      node = self
      loop do
        node = node.parent
        yield node
      end
    end
Iterates over the nodes above this in the tree hierarchy and yields them
 to a block. If no block is given an enumerator is returned.

 @yield  [Node] each parent node.
 @return [Enumerator] if no block is given.