Module

Trav

Includes:

There's no documentation for this item.

Public Methods
classes Returns a list of CSS classes to which this element belongs.
containers Return all children of this node which can contain other nodes. This is a good way to get all HTML elements which aren’t text, comment, doctype or processing instruction nodes.
each_child each_child iterates over each child.
each_child_with_index each_child_with_index iterates over each child.
each_hyperlink each_hyperlink traverses hyperlinks such as HTML href attribute of A element.
each_hyperlink_uri each_hyperlink_uri traverses hyperlinks such as HTML href attribute of A element.
each_uri each_uri traverses hyperlinks such as HTML href attribute of A element.
filter filter rebuilds the tree without some components.
find_element find_element searches an element which universal name is specified by the arguments. It returns nil if not found.
following_siblings Find sibling elements which follow the current one. Like the other "sibling" methods, this weeds out text and comment nodes.
get_element_by_id
get_elements_by_tag_name
insert_after Insert nodes, an array of HTML elements or a single element, after the node ele, a child of the current node.
insert_before Insert nodes, an array of HTML elements or a single element, before the node ele, a child of the current node.
next_sibling Returns the container node neighboring this node to the south: just below it. By "container" node, I mean: this method does not find text nodes or comments or cdata or any of that. See Hpricot::Traverse#next_node if you need to hunt out all kinds of nodes.
preceding_siblings Find all preceding sibling elements. Like the other "sibling" methods, this weeds out text and comment nodes.
previous_sibling Returns the container node neighboring this node to the north: just above it. By "container" node, I mean: this method does not find text nodes or comments or cdata or any of that. See Hpricot::Traverse#previous_node if you need to hunt out all kinds of nodes.
replace_child Replace old, a child of the current node, with new node.
siblings_at Puts together an array of neighboring sibling elements based on their proximity to this element.
Private Methods
each_hyperlink_attribute
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.