Adds an attribute to this element, overwriting any existing attribute by the same name.
can be either an Attribute
or a String. If an Attribute
, the attribute is added to the list of Element
attributes. If String, the argument is used as the name of the new attribute, and the value parameter must be supplied.
Required if key
is a String, and ignored if the first argument is an Attribute
. This is a String, and is used as the value of the new Attribute
. This should be the unnormalized value of the attribute (without entities).
the Attribute
added
e = Element.new 'e' e.add_attribute( 'a', 'b' ) #-> <e a='b'/> e.add_attribute( 'x:a', 'c' ) #-> <e a='b' x:a='c'/> e.add_attribute Attribute.new('b', 'd') #-> <e a='b' x:a='c' b='d'/>
Add multiple attributes to this element.
is either a hash, or array of arrays
el.add_attributes( {"name1"=>"value1", "name2"=>"value2"} ) el.add_attributes( [ ["name1","value1"], ["name2"=>"value2"] ] )
Removes an attribute
either an Attribute
or a String. In either case, the attribute is found by matching the attribute name to the argument, and then removed. If no attribute is found, no action is taken.
the attribute removed, or nil if this Element
did not contain a matching attribute
e = Element.new('E') e.add_attribute( 'name', 'Sean' ) #-> <E name='Sean'/> r = e.add_attribute( 'sur:name', 'Russell' ) #-> <E name='Sean' sur:name='Russell'/> e.delete_attribute( 'name' ) #-> <E sur:name='Russell'/> e.delete_attribute( r ) #-> <E/>
Iterates over the attributes of an Element
. Yields actual Attribute
nodes, not String values.
doc = Document.new '<a x="1" y="2"/>' doc.root.attributes.each_attribute {|attr| p attr.expanded_name+" => "+attr.value }
Fetches an attribute
the name by which to search for the attribute. Can be a prefix:name
namespace name.
The first matching attribute, or nil if there was none. This
value is an Attribute
node, not the String value of the attribute.
doc = Document.new '<a x:foo="1" foo="2" bar="3"/>' doc.root.attributes.get_attribute("foo").value #-> "2" doc.root.attributes.get_attribute("x:foo").value #-> "1"
@return the current line in the source
@return the current line in the source
Creates threads that pick up UDP packets and passes them to do_write
for decoding.
Extracts the response URI
from msg
and adds it to TupleSpace
where it will be picked up by reply_service
for notification.
Looks up RingServers waiting timeout
seconds. RingServers will be given block
as a callback, which will be called with the remote TupleSpace
.
Returns the paths to the source files for use with analysis and documentation tools. These paths are relative to full_gem_path.
Ensure that the dependency is satisfied by the current installation of gem. If it is not an exception is raised.
Writes the .gemspec specification (in Ruby) to the gem home’s specifications directory.
Verifies entry
in a .gem file.
Verifies the files of the gem