Method: Nokogiri::XML::Node#traverse

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

#traverse {|_self| ... } ⇒ Object

Yields self and all children to block recursively.

Yields:

  • (_self)

Yield Parameters:


1140
1141
1142
1143
# File 'lib/nokogiri/xml/node.rb', line 1140

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