Class: ActiveFedora::Noid::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/active_fedora/noid/config.rb

Instance Attribute Summary collapse

Instance Attribute Details

#minter_classObject


20
21
22
# File 'lib/active_fedora/noid/config.rb', line 20

def minter_class
  @minter_class ||= Minter::File
end

#namespaceObject


16
17
18
# File 'lib/active_fedora/noid/config.rb', line 16

def namespace
  @namespace ||= 'default'
end

#statefileObject


12
13
14
# File 'lib/active_fedora/noid/config.rb', line 12

def statefile
  @statefile ||= '/tmp/minter-state'
end

#templateObject


8
9
10
# File 'lib/active_fedora/noid/config.rb', line 8

def template
  @template ||= '.reeddeeddk'
end

#translate_id_to_uriObject


30
31
32
33
34
# File 'lib/active_fedora/noid/config.rb', line 30

def translate_id_to_uri
  lambda do |id|
    "#{baseurl}/#{ActiveFedora::Noid.treeify(id)}"
  end
end

#translate_uri_to_idObject


24
25
26
27
28
# File 'lib/active_fedora/noid/config.rb', line 24

def translate_uri_to_id
  lambda do |uri|
    uri.to_s.sub(baseurl, '').split('/', baseparts).last
  end
end