Method: Nokogiri::XML::Node#traverse

Defined in:
lib/nokogiri/xml/node.rb

#traverse(&block) ⇒ Object

Yields self and all children to block recursively.


978
979
980
981
# File 'lib/nokogiri/xml/node.rb', line 978

def traverse(&block)
  children.each { |j| j.traverse(&block) }
  block.call(self)
end