Sha256: ea5395d0151287e5c74ecc5204a4946f88e1c7a2e81eae048939479c71a12ca3

Contents?: true

Size: 502 Bytes

Versions: 1

Compression:

Stored size: 502 Bytes

Contents

module Ddr
  module Models
    module PermanentIdentification
      extend ActiveSupport::Concern

      PERMALINK_BASE_URL = 'http://id.library.duke.edu/'

      included do
        has_attributes :permanent_id, datastream: Ddr::Datastreams::PROPERTIES, multiple: false

        def self.permalink(permanent_id)
          permanent_id.present? ? PERMALINK_BASE_URL + permanent_id : nil
        end

      end

      def permalink
        self.class.permalink(permanent_id)
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ddr-models-1.5.0 lib/ddr/models/permanent_identification.rb