class Elements
Includes Enumerable
A class which provides filtering of children for Elements, and XPath search support.
Methods
Aliases
<<
is a synonym for
add
Methods
[]
Returns
the first matching Element, or nil if no child matched
Fetches a child element
[]=
Returns
the previous element; nil if no previous element was found.
Sets an element, replacing any previous matching element. If no existing element is found ,the element is added.
add
Returns
the added Element
Adds an element
delete
Returns
the removed child
Deletes a child Element
delete_all
Returns
an Array of Elements that have been removed
Removes multiple elements
each
Iterates through all of the child Elements, optionally filtering them by a given XPath Only supply the first parameter (and a block). The second parameter is used internally for recursion.
empty
Returns
true if there are no Element children, false otherwise
index
Returns
the index of the supplied child (starting at 1), or -1 if the element is not a child
@return the index of the supplied child (starting at 1), or -1 if the element is not a child