Google

def size count = 0 @element.each {|child| count+=1 if child.kind_of? Element } count end