Keystrokes of GNU Readline
will timeout it with the specification of “keyseq-timeout” when waiting for the 2nd character after the 1st one. If the 2nd character comes after 1st ESC without timeout it has a meta-property of meta-key to discriminate modified key with meta-key from multibyte characters that come with 8th bit on.
GNU Readline
will wait for the 2nd character with “keyseq-timeout” milli-seconds but wait forever after 3rd characters.
Iterates over all IP addresses for name
retrieved from the hosts file.
Iterates over all IP addresses for name
retrieved from the DNS
resolver.
name
can be a Resolv::DNS::Name
or a String
. Retrieved addresses will be a Resolv::IPv4
or Resolv::IPv6
Iterates over all typeclass
DNS
resources for name
. See getresource
for argument details.
Iterates over all IP addresses for name
retrieved from the mDNS resolver, provided name ends with “local”. If the name does not end in “local” no records will be returned.
name
can be a Resolv::DNS::Name
or a String
. Retrieved addresses will be a Resolv::IPv4
or Resolv::IPv6
Replaces this object with another object. Basically, calls Parent.replace_child
self
Sets the previous sibling of this child. This can be used to insert a child before some other child.
a = Element.new("a") b = a.add_element("b") c = Element.new("c") b.previous_sibling = c # => <a><b/><c/></a>
Adds a child to this element, optionally setting attributes in the element.
optional. If Element
, the element is added. Otherwise, a new Element
is constructed with the argument (see Element.initialize).
If supplied, must be a Hash
containing String
name,value pairs, which will be used to set the attributes of the new Element
.
the Element
that was added
el = doc.add_element 'my-tag' el = doc.add_element 'my-tag', {'attr1'=>'val1', 'attr2'=>'val2'} el = Element.new 'my-tag' doc.add_element el
Deletes a child element.
Must be an Element
, String
, or Integer
. If Element
, the element is removed. If String
, the element is found (via XPath
) and removed. <em>This means that any parent can remove any descendant.<em> If Integer
, the Element
indexed by that number will be removed.
the element that was removed.
doc.delete_element "/a/b/c[@id='4']" doc.delete_element doc.elements["//k"] doc.delete_element 1
Evaluates to true
if this element has at least one child Element
doc = Document.new "<a><b/><c>Text</c></a>" doc.root.has_elements # -> true doc.elements["/a/b"].has_elements # -> false doc.elements["/a/c"].has_elements # -> false
Synonym for Element.elements
.each
Synonym for Element.to_a This is a little slower than calling elements.each directly.
Returns the next sibling that is an element, or nil if there is no Element
sibling after this one
doc = Document.new '<a><b/>text<c/></a>' doc.root.elements['b'].next_element #-> <c/> doc.root.elements['c'].next_element #-> nil