Class: XPath::AncestorIterator

Inherits:
ReverseAxisIterator show all
Defined in:
lib/xml/xpath.rb

Direct Known Subclasses

AncestorOrSelfIterator

Instance Method Summary collapse

Methods inherited from ReverseAxisIterator

#reverse_order?

Methods inherited from AxisIterator

#reverse_order?

Instance Method Details

#each(node, visitor) ⇒ Object



2588
2589
2590
2591
2592
2593
2594
2595
2596
# File 'lib/xml/xpath.rb', line 2588

def each(node, visitor)
  node = visitor.visit(node).parent
  while node
    i = visitor.visit(node)
    parent = i.parent
    yield i
    node = parent
  end
end