A Tag is any node that represents markup. It may be an opening tag, a
closing tag, or a self-closing tag. It has a name, and may have a hash of
attributes.
| Public Attributes |
| attributes |
Either nil, or a hash of attributes for this node.
|
| closing |
Either nil, :close, or :self
|
| name |
The name of this tag.
|
| Public Methods |
| == |
|
| [] |
A convenience for obtaining an attribute of the node. Returns nil
if the node has no attributes.
|
| childless? |
Returns non-nil if this tag can contain child nodes.
|
| find |
If either the node or any of its children meet the given conditions, the
matching node is returned. Otherwise, nil is returned. (See the
description of the valid conditions in the match method.)
|
| match |
Returns true if the node meets any of the given conditions. The
conditions parameter must be a hash of any of the following keys
(all are optional):
|
| new |
Create a new node as a child of the given parent, using the given content
to describe the node. It will be parsed and the node name, attributes and
closing status extracted.
|
| select |
|
| tag? |
Returns true, indicating that this node represents an HTML tag.
|
| to_s |
Returns a textual representation of the node
|
| Private Methods |
| match_condition |
Match the given value to the given condition.
|
<code/>and<pre/>for code samples.