class Fieldhand::Identify
Information about a repository.
See www.openarchives.org/OAI/openarchivesprotocol.html#Identify
Attributes
Public Class Methods
Return a new Identify
with the given element and optional response date.
Defaults the response date to the current time.
# File lib/fieldhand/identify.rb, line 16 def initialize(element, response_date = Time.now) @element = element @response_date = response_date end
Public Instance Methods
Return any e-mail addresses of administrators of the repository as an array of strings.
# File lib/fieldhand/identify.rb, line 66 def admin_emails @admin_emails ||= element.locate('adminEmail/^String') end
Return the base URL of the repository as a URI.
See www.openarchives.org/OAI/openarchivesprotocol.html#HTTPRequestFormat
# File lib/fieldhand/identify.rb, line 29 def base_url @base_url ||= URI(element.baseURL.text) end
Return any compression encodings supported by the repository as an array of strings.
# File lib/fieldhand/identify.rb, line 71 def compression @compression ||= element.locate('compression/^String') end
Return the manner in which the repository supports the notion of deleted records as a string.
Possible values are:
-
no
-
transient
-
persistent
See www.openarchives.org/OAI/openarchivesprotocol.html#DeletedRecords
# File lib/fieldhand/identify.rb, line 53 def deleted_record @deleted_record ||= element.deletedRecord.text end
Return any raw description elements used by communities to describe their repositories as an array of strings.
As these can be in any format, Fieldhand
does not attempt to parse the elements but leaves that to users.
# File lib/fieldhand/identify.rb, line 78 def descriptions @descriptions ||= element.locate('description') end
Return the guaranteed lower limit of all datestamps recording changes, modifications, or deletions in the repository as a `Date` or `Time` depending on the granularity of the repository.
# File lib/fieldhand/identify.rb, line 40 def earliest_datestamp @earliest_datestamp ||= Datestamp.parse(element.earliestDatestamp.text) end
Return the finest harvesting granularity supported by the repository. The legitimate values are YYYY-MM-DD and YYYY-MM-DDThh:mm:ssZ with meanings as defined in ISO 8601.
See www.w3.org/TR/NOTE-datetime
# File lib/fieldhand/identify.rb, line 61 def granularity @granularity ||= element.granularity.text end
Return the human readable name for the repository.
# File lib/fieldhand/identify.rb, line 22 def name @name ||= element.repositoryName.text end
Return the version of the OAI-PMH protocol supported by the repository as a string.
# File lib/fieldhand/identify.rb, line 34 def protocol_version @protocol_version ||= element.protocolVersion.text end