class Fieldhand::IdentifyParser

A parser for Identify responses.

See www.openarchives.org/OAI/openarchivesprotocol.html#Identify

Attributes

response_parser[R]

Public Class Methods

new(response_parser) click to toggle source

Return a new parser for the given response parser.

# File lib/fieldhand/identify_parser.rb, line 13
def initialize(response_parser)
  @response_parser = response_parser
end

Public Instance Methods

items() click to toggle source

Return an array of `Identify`s found in the response.

In reality, there will only ever be at most one `Identify` in a response but having a consistent interface with the other parsers keeps the supporting code simpler.

# File lib/fieldhand/identify_parser.rb, line 21
def items
  response_parser.
    root.
    locate('Identify').
    map { |item| Identify.new(item, response_parser.response_date) }
end