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
XDM::Nodes 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.
46 47 48 |
# File 'lib/saxon/xpath/executable.rb', line 46 def initialize(result_iterator) @result_iterator = result_iterator end |
Instance Method Details
#each {|xdm_node| ... } ⇒ Object
Yields XDM::Nodes from the query result. If no block is passed, returns an Enumerator
53 54 55 |
# File 'lib/saxon/xpath/executable.rb', line 53 def each(&block) @result_iterator.lazy.map { |s9_xdm_node| Saxon::XDM::Node.new(s9_xdm_node) }.each(&block) end |