Module: Sufia::Noid

Extended by:
ActiveSupport::Concern
Included in:
Batch, Collection, GenericFile
Defined in:
app/services/sufia/noid.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.namespaceize(identifier) ⇒ Object



27
28
29
30
# File 'app/services/sufia/noid.rb', line 27

def namespaceize(identifier)
  return identifier if identifier.include?(':')
  "#{namespace}:#{identifier}"
end

.noidify(identifier) ⇒ Object



23
24
25
# File 'app/services/sufia/noid.rb', line 23

def noidify(identifier)
  String(identifier).split(":").last
end

Instance Method Details

#noidObject



13
14
15
# File 'app/services/sufia/noid.rb', line 13

def noid
  Noid.noidify(self.pid)
end

#to_paramObject

Redefine this for more intuitive keys in Redis



18
19
20
# File 'app/services/sufia/noid.rb', line 18

def to_param
  noid
end