class Fieldhand::MetadataFormat
A metadata format supported by the repository.
See www.openarchives.org/OAI/openarchivesprotocol.html#ListMetadataFormats
Attributes
element[R]
response_date[R]
Public Class Methods
new(element, response_date = Time.now)
click to toggle source
Return a new Metadata Format for the given element with an optional response date.
The response date defaults to the current time.
# File lib/fieldhand/metadata_format.rb, line 15 def initialize(element, response_date = Time.now) @element = element @response_date = response_date end
Public Instance Methods
namespace()
click to toggle source
Return the XML Namespace URI for the format.
# File lib/fieldhand/metadata_format.rb, line 38 def namespace @namespace ||= URI(element.metadataNamespace.text) end
prefix()
click to toggle source
Return the string metadata prefix for the format.
# File lib/fieldhand/metadata_format.rb, line 28 def prefix @prefix ||= element.metadataPrefix.text end
schema()
click to toggle source
Return the location of an XML Schema describing the format as a URI.
# File lib/fieldhand/metadata_format.rb, line 33 def schema @schema ||= URI(element.schema.text) end
to_s()
click to toggle source
Return the prefix as a string representation of the format.
This makes it possible to pass a Metadata Format to methods that expect a string metadata prefix.
# File lib/fieldhand/metadata_format.rb, line 23 def to_s prefix end