class Dor::PidUtils

Utilties for manipulating druids

Constants

PID_REGEX

Public Class Methods

remove_druid_prefix(druid) click to toggle source

Since purl does not use the druid: prefix but much of dor does, use this function to strip the druid: if needed @return [String] the druid sans the druid: or if there was no druid: prefix, the entire string you passed

# File lib/dor/utils/pid_utils.rb, line 9
def self.remove_druid_prefix(druid)
  result = druid.match(PID_REGEX)
  result.nil? ? druid : result[0] # if no matches, return the string passed in, otherwise return the match
end