Class: Saxon::XPath::Result
- Inherits:
-
Object
- Object
- Saxon::XPath::Result
- Includes:
- Enumerable
- Defined in:
- lib/saxon/xpath/executable.rb
Overview
The result of executing an XPath query as an enumerable object
Instance Method Summary collapse
-
#each {|xdm_node| ... } ⇒ Object
Yields
XdmNodes from the query result. -
#initialize(result_iterator) ⇒ Result
constructor
private
A new instance of Result.
Constructor Details
#initialize(result_iterator) ⇒ Result
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Result.
47 48 49 |
# File 'lib/saxon/xpath/executable.rb', line 47 def initialize(result_iterator) @result_iterator = result_iterator end |
Instance Method Details
#each {|xdm_node| ... } ⇒ Object
Yields XdmNodes from the query result. If no block is passed, returns an Enumerator
54 55 56 |
# File 'lib/saxon/xpath/executable.rb', line 54 def each(&block) @result_iterator.lazy.map { |s9_xdm_node| Saxon::XdmNode.new(s9_xdm_node) }.each(&block) end |