class Fieldhand::Header
Contains the unique identifier of the item and properties necessary for selective harvesting. The header consists of the following parts:
-
the unique identifier – the unique identifier of an item in a repository;
-
the datestamp – the date of creation, modification or deletion of the record for the purpose of selective harvesting.
-
zero or more setSpec elements – the set membership of the item for the purpose of selective harvesting.
-
an optional status attribute with a value of deleted indicates the withdrawal of availability of the specified metadata format for the item, dependent on the repository support for deletions.
See www.openarchives.org/OAI/openarchivesprotocol.html#header
Attributes
Public Class Methods
Return a new Header
with the given element and an optional response date.
Defaults the response date to the current time.
# File lib/fieldhand/header.rb, line 23 def initialize(element, response_date = Time.now) @element = element @response_date = response_date end
Public Instance Methods
Return the UTC datestamp of this item.
# File lib/fieldhand/header.rb, line 47 def datestamp @datestamp ||= Datestamp.parse(element.datestamp.text) end
Test whether this item is marked as deleted or not.
Note that a repository's support for deleted records can be interrogated through the `Identify` request, see www.openarchives.org/OAI/openarchivesprotocol.html#DeletedRecords
# File lib/fieldhand/header.rb, line 32 def deleted? status == 'deleted' end
Return the unique identifier of this item.
# File lib/fieldhand/header.rb, line 42 def identifier @identifier ||= element.identifier.text end
Return any set memberships of this item.
# File lib/fieldhand/header.rb, line 52 def sets @sets ||= element.locate('setSpec/^String') end
Return the optional status of this item.
# File lib/fieldhand/header.rb, line 37 def status element['status'] end