[]=

[]=( name, value )
Instance Public methods

Sets an attribute, overwriting any existing attribute value by the same name. Namespace is significant.

name

the name of the attribute

value

(optional) If supplied, the value of the attribute. If nil, any existing matching attribute is deleted.

Returns

Owning element

doc = Document.new "<a x:foo='1' foo='3'/>"
doc.root.attributes['y:foo'] = '2'
doc.root.attributes['foo'] = '4'
doc.root.attributes['x:foo'] = nil
doc_ruby_on_rails
2015-05-06 01:20:27
Comments
Leave a Comment

Please login to continue.