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
-
#append(other) ⇒ XDM::Value
(also: #<<, #+)
Return a new XDM::Value from this Sequence with the passed in value appended to the end.
-
#sequence_enum ⇒ Object
Implementors should return an Enumerator over the Sequence.
-
#sequence_size ⇒ Integer
Implementors should return the size of the Sequence.
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.
23 24 25 |
# File 'lib/saxon/xdm/sequence_like.rb', line 23 def append(other) XDM::Value.create([self, other]) end |
#sequence_enum ⇒ Object
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.
9 10 11 |
# File 'lib/saxon/xdm/sequence_like.rb', line 9 def sequence_enum raise NotImplementedError end |
#sequence_size ⇒ Integer
Implementors should return the size of the Sequence. For AtomicValue this will always be 1.
16 17 18 |
# File 'lib/saxon/xdm/sequence_like.rb', line 16 def sequence_size raise NotImplementedError end |