module ActiveFedora::Identifiable

def self.translate_id_to_uri=(translator)

def self.translate_id_to_uri=(translator)
  @@translate_id_to_uri = translator || Core::FedoraIdTranslator
end

def self.translate_uri_to_id=(translator)

def self.translate_uri_to_id=(translator)
  @@translate_uri_to_id = translator || Core::FedoraUriTranslator
end

def id

def id
  if uri.kind_of?(::RDF::URI) && uri.value.blank?
    nil
  elsif uri.present?
    self.class.uri_to_id(URI.parse(uri))
  end
end

def id=(id)

def id=(id)
  raise "ID has already been set to #{self.id}" if self.id
  @ldp_source = build_ldp_resource(id.to_s)
end

def pid

TODO: Remove after we no longer support #pid.
def pid
  Deprecation.warn FedoraAttributes, "#{self.class}#pid is deprecated and will be removed in active-fedora 10.0. Use #{self.class}#id instead."
  id
end

def uri

Returns:
  • (RDF::URI) - the uri for this resource
def uri
  @ldp_source.subject_uri
end