XML_Element.attribute
attributenameif_missing
Group: Selections
Documentation
Get an attribute of an XML element.
Arguments
name
: The name of the attribute to get.if_missing
: The value returned if the attribute does not exist.
Examples
Get an attribute of an element.
root = XML_Document.from_text '<foo bar="one">hello</foo>' . root_element
root.attribute "bar"
# => "one"