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:



1239
1240
1241
1242
# File 'lib/nokogiri/xml/node.rb', line 1239

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