Class: OAI::ListRecordsResponse

Inherits:
Response
  • Object
show all
Includes:
Enumerable, XPath
Defined in:
lib/oai/client/list_records.rb

Overview

allows for iteration across a list of records

for record in client.list_records :metadata_prefix => 'oai_dc':
  puts record.metadata
end

you’ll need to handle resumption tokens

Instance Attribute Summary

Attributes inherited from Response

#doc, #resumption_token

Instance Method Summary collapse

Methods included from XPath

#get_attribute, #xpath, #xpath_all, #xpath_first

Methods inherited from Response

#initialize

Constructor Details

This class inherits a constructor from OAI::Response

Instance Method Details

#eachObject



15
16
17
18
19
# File 'lib/oai/client/list_records.rb', line 15

def each
  for record_element in xpath_all(@doc, './/ListRecords/record')
    yield OAI::Record.new(record_element)
  end
end