size()
public
Returns the number of Element
children of the parent object. doc = Document.new
‘<a>seanelliottrussell’ doc.root.size #-> 6, 3 element
and 3 text nodes doc.root.elements.size #-> 3
Show source
def size
count = 0
@element.each {|child| count+=1 if child.kind_of? Element }
count
end