class Fieldhand::Header

Contains the unique identifier of the item and properties necessary for selective harvesting. The header consists of the following parts:

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

Attributes

element[R]
response_date[R]

Public Class Methods

new(element, response_date = Time.now) click to toggle source

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

datestamp() click to toggle source

Return the UTC datestamp of this item.

# File lib/fieldhand/header.rb, line 47
def datestamp
  @datestamp ||= Datestamp.parse(element.datestamp.text)
end
deleted?() click to toggle source

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
identifier() click to toggle source

Return the unique identifier of this item.

# File lib/fieldhand/header.rb, line 42
def identifier
  @identifier ||= element.identifier.text
end
sets() click to toggle source

Return any set memberships of this item.

# File lib/fieldhand/header.rb, line 52
def sets
  @sets ||= element.locate('setSpec/^String')
end
status() click to toggle source

Return the optional status of this item.

# File lib/fieldhand/header.rb, line 37
def status
  element['status']
end