Class: Fieldhand::ListIdentifiersParser

Inherits:
Object
  • Object
show all
Defined in:
lib/fieldhand/list_identifiers_parser.rb

Overview

A parser for ListIdentifiers responses.

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_parser) ⇒ ListIdentifiersParser

Return a new parser for the given response parser.



13
14
15
# File 'lib/fieldhand/list_identifiers_parser.rb', line 13

def initialize(response_parser)
  @response_parser = response_parser
end

Instance Attribute Details

#response_parserObject (readonly)

Returns the value of attribute response_parser.



10
11
12
# File 'lib/fieldhand/list_identifiers_parser.rb', line 10

def response_parser
  @response_parser
end

Instance Method Details

#itemsObject

Return an array of ‘Header`s found in the response.



18
19
20
21
22
23
# File 'lib/fieldhand/list_identifiers_parser.rb', line 18

def items
  response_parser.
    root.
    locate('ListIdentifiers/header').
    map { |item| Header.new(item, response_parser.response_date) }
end