Class

Attributes

Extends:

A class that defines the set of Attributes of an Element and provides operations for accessing elements in that set.

Public Methods
<< Alias for #add
[] Fetches an attribute value. If you want to get the Attribute itself, use get_attribute()
[]= Sets an attribute, overwriting any existing attribute value by the same name. Namespace is significant.
add Adds an attribute, overriding any existing attribute by the same name. Namespaces are significant.
delete Removes an attribute
delete_all Deletes all attributes matching a name. Namespaces are significant.
each Itterates over each attribute of an Element, yielding the expanded name and value as a pair of Strings.
each_attribute Itterates over the attributes of an Element. Yields actual Attribute nodes, not String values.
get_attribute Fetches an attribute
get_attribute_ns The get_attribute_ns method retrieves a method by its namespace and name. Thus it is possible to reliably identify an attribute even if an XML processor has changed the prefix.
length Returns the number of attributes the owning Element contains.
namespaces
new Constructor
prefixes Returns an array of Strings containing all of the prefixes declared by this set of # attributes. The array does not include the default namespace declaration, if one exists.
size Alias for #length
to_a
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.