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