Module: Saxon::XDM::SequenceLike

Included in:
Array, AtomicValue, EmptySequence, ExternalObject, FunctionItem, Map, Node, Value
Defined in:
lib/saxon/xdm/sequence_like.rb

Overview

Mixin for objects that are XDM Sequence-like in behaviour

Instance Method Summary collapse

Instance Method Details

#append(other) ⇒ XDM::Value Also known as: <<, +

Return a new XDM::Value from this Sequence with the passed in value appended to the end.

Returns:



23
24
25
# File 'lib/saxon/xdm/sequence_like.rb', line 23

def append(other)
  XDM::Value.create([self, other])
end

#sequence_enumObject

Implementors should return an Enumerator over the Sequence. For Values, this will just be the items in the sequence. For XDM::AtomicValue or XDM::Node, this will be a single-item Enumerator so that Items can be correctly treated as single-item Values.

Raises:

  • (NotImplementedError)


9
10
11
# File 'lib/saxon/xdm/sequence_like.rb', line 9

def sequence_enum
  raise NotImplementedError
end

#sequence_sizeInteger

Implementors should return the size of the Sequence. For AtomicValue this will always be 1.

Returns:

  • (Integer)

    the sequence size

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/saxon/xdm/sequence_like.rb', line 16

def sequence_size
  raise NotImplementedError
end