Class: Fieldhand::IdentifyParser
- Inherits:
-
Object
- Object
- Fieldhand::IdentifyParser
- Defined in:
- lib/fieldhand/identify_parser.rb
Overview
A parser for Identify responses.
See www.openarchives.org/OAI/openarchivesprotocol.html#Identify
Instance Attribute Summary collapse
-
#response_parser ⇒ Object
readonly
Returns the value of attribute response_parser.
Instance Method Summary collapse
-
#initialize(response_parser) ⇒ IdentifyParser
constructor
Return a new parser for the given response parser.
-
#items ⇒ Object
Return an array of ‘Identify`s found in the response.
Constructor Details
#initialize(response_parser) ⇒ IdentifyParser
Return a new parser for the given response parser.
11 12 13 |
# File 'lib/fieldhand/identify_parser.rb', line 11 def initialize(response_parser) @response_parser = response_parser end |
Instance Attribute Details
#response_parser ⇒ Object (readonly)
Returns the value of attribute response_parser.
8 9 10 |
# File 'lib/fieldhand/identify_parser.rb', line 8 def response_parser @response_parser end |
Instance Method Details
#items ⇒ Object
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.
19 20 21 22 23 24 |
# File 'lib/fieldhand/identify_parser.rb', line 19 def items response_parser. root. locate('Identify'). map { |item| Identify.new(item, response_parser.response_date) } end |