Constructor
if not supplied, will be set to the default value. If a String, the name of this object will be set to the argument. If an Element
, the object will be shallowly cloned; name, attributes, and namespaces will be copied. Children will not
be copied.
if supplied, must be a Parent
, and will be used as the parent of this object.
If supplied, must be a hash containing context items. Context items include:
:respect_whitespace
the value of this is :all
or an array of strings being the names of the elements to respect whitespace for. Defaults to :all
.
:compress_whitespace
the value can be :all
or an array of strings being the names of the elements to ignore whitespace on. Overrides :respect_whitespace
.
:ignore_whitespace_nodes
the value can be :all
or an array of strings being the names of the elements in which to ignore whitespace-only nodes. If this is set, Text
nodes which contain only whitespace will not be added to the document tree.
:raw
can be :all
, or an array of strings being the names of the elements to process in raw mode. In raw mode, special characters in text is not converted to or from entities.
Create a new entity. Simple entities can be constructed by passing a name, value to the constructor; this creates a generic, plain entity reference. For anything more complicated, you have to pass a Source
to the constructor with the entity definition, or use the accessor methods. WARNING
: There is no validation of entity state except when the entity is read from a stream. If you start poking around with the accessors, you can easily create a non-conformant Entity
.
e = Entity.new( 'amp', '&' )
Constructs a new Instruction
@param target can be one of a number of things. If String, then the target of this instruction is set to this. If an Instruction
, then the Instruction
is shallowly cloned (target and content are copied). If a Source
, then the source is scanned and parsed for an Instruction
declaration. @param content Must be either a String, or a Parent
. Can only be a Parent
if the target argument is a Source
. Otherwise, this String is set as the content of this instruction.
Constructor @param parent if supplied, will be set as the parent of this object
Constructor @param arg must be a String, and should be a valid XML
document @param encoding if non-null, sets the encoding of the source to this value, overriding all encoding detection
block_size has been deprecated
Creates a new SyncEnumerator
which enumerates rows of given Enumerable
objects.
Constructor arg
if a String, the content is set to the String. If a Text
, the object is shallowly cloned.
respect_whitespace
(boolean, false) if true, whitespace is respected
parent
(nil) if this is a Parent
object, the parent will be set to this.
raw
(nil) This argument can be given three values. If true, then the value of used to construct this object is expected to contain no unescaped XML
markup, and REXML
will not change the text. If this value is false, the string may contain any characters, and REXML
will escape any and all defined entities whose values are contained in the text. If this value is nil (the default), then the raw value of the parent will be used as the raw value for this node. If there is no raw value for the parent, and no value is supplied, the default is false. Use this field if you have entities defined for some text, and you don’t want REXML
to escape that text in output.
Text.new( "<&", false, nil, false ) #-> "<&" Text.new( "<&", false, nil, false ) #-> "&lt;&amp;" Text.new( "<&", false, nil, true ) #-> Parse exception Text.new( "<&", false, nil, true ) #-> "<&" # Assume that the entity "s" is defined to be "sean" # and that the entity "r" is defined to be "russell" Text.new( "sean russell" ) #-> "&s; &r;" Text.new( "sean russell", false, nil, true ) #-> "sean russell"
entity_filter
(nil) This can be an array of entities to match in the supplied text. This argument is only useful if raw
is set to false.
Text.new( "sean russell", false, nil, false, ["s"] ) #-> "&s; russell" Text.new( "sean russell", false, nil, true, ["s"] ) #-> "sean russell"
In the last example, the entity_filter
argument is ignored.
illegal
INTERNAL USE ONLY
Creates a new DRbObjectTemplate
that will match against uri
and ref
.
Creates a new TupleSpaceProxy
to wrap ts
.
Creates a new SimpleRenewer
that keeps an object alive for another sec
seconds.
Advertises ts
on the given addresses
at port
.
If addresses
is omitted only the UDP broadcast address is used.
addresses
can contain multiple addresses. If a multicast address is given in addresses
then the RingServer
will listen for multicast queries.
If you use IPv4 multicast you may need to set an address of the inbound interface which joins a multicast group.
ts = Rinda::TupleSpace.new rs = Rinda::RingServer.new(ts, [['239.0.0.1', '9.5.1.1']])
You can set addresses as an Array Object
. The first element of the Array is a multicast address and the second is an inbound interface address. If the second is omitted then ‘0.0.0.0’ is used.
If you use IPv6 multicast you may need to set both the local interface address and the inbound interface index:
rs = Rinda::RingServer.new(ts, [['ff02::1', '::1', 1]])
The first element is a multicast address and the second is an inbound interface address. The third is an inbound interface index.
At this time there is no easy way to get an interface index by name.
If the second is omitted then ‘::1’ is used. If the third is omitted then 0 (default interface) is used.
Creates a new RingFinger
that will look for RingServers at port
on the addresses in broadcast_list
.
If broadcast_list
contains a multicast address then multicast queries will be made using the given multicast_hops
and multicast_interface.
Creates a RingProvider
that will provide a klass
service running on front
, with a description
. renewer
is optional.
Creates a TupleEntry
based on ary
with an optional renewer or expiry time sec
.
A renewer must implement the renew
method which returns a Numeric
, nil, or true to indicate when the tuple has expired.
Creates a new NotifyTemplateEntry
that watches place
for +event+s that match tuple
.