Sha256: d5e4f1e91280618502430b12c7c0ea1055bb659c88af14b81a03ff6822235c4c

Contents?: true

Size: 518 Bytes

Versions: 1

Compression:

Stored size: 518 Bytes

Contents

module BlacklightOaiProvider
  module SolrDocument
    extend ActiveSupport::Concern

    def timestamp
      timestamp = get(self.class.timestamp_key)
      raise BlacklightOaiProvider::Exceptions::MissingTimestamp if timestamp.blank?
      Time.zone.parse(timestamp) # Solr timestamps are all in UTC.
    end

    def to_oai_dc
      export_as('oai_dc_xml')
    end

    module ClassMethods
      attr_writer :timestamp_key

      def timestamp_key
        @timestamp_key ||= 'timestamp'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blacklight_oai_provider-4.1.0 app/models/concerns/blacklight_oai_provider/solr_document.rb