Class: Nokogiri::XML::Document
- Defined in:
- lib/nokogiri/ext/traverse_count/document.rb
Instance Method Summary collapse
-
#traverse_count ⇒ Integer
Calculates the sum of all sub-children of the document.
Methods inherited from Node
Instance Method Details
#traverse_count ⇒ Integer
Calculates the sum of all sub-children of the document.
18 19 20 21 22 23 24 |
# File 'lib/nokogiri/ext/traverse_count/document.rb', line 18 def traverse_count if root 1 + root.traverse_count else 0 end end |