Class: SRU::SearchResponse
- Includes:
- Enumerable
- Defined in:
- lib/sru/search_retrieve.rb
Overview
Instance Attribute Summary
Attributes inherited from Response
Instance Method Summary collapse
-
#each ⇒ Object
Returns the contents of each recordData element in a SRU searchRetrieve response.
- #number_of_records ⇒ Object
Methods inherited from Response
Methods included from XPath
#get_attribute, #xpath, #xpath_all, #xpath_first
Constructor Details
This class inherits a constructor from SRU::Response
Instance Method Details
#each ⇒ Object
Returns the contents of each recordData element in a SRU searchRetrieve response.
24 25 26 27 28 29 30 31 |
# File 'lib/sru/search_retrieve.rb', line 24 def each obj = xpath_all(@doc, './/zs:recordData', @namespaces) for record_data in obj if obj.size > 0 yield record_data end end end |
#number_of_records ⇒ Object
17 18 19 |
# File 'lib/sru/search_retrieve.rb', line 17 def number_of_records return Integer(xpath(@doc, './/zs:numberOfRecords', @namespaces)) end |