index(element)
public
Returns the index of the supplied
child (starting at 1), or -1 if the element is not a child
Show source
def index element
rv = 0
found = @element.find do |child|
child.kind_of? Element and
(rv += 1) and
child == element
end
return rv if found == element
return -1
end