Module: ActiveFedora::Noid

Defined in:
lib/active_fedora/noid.rb,
lib/active_fedora/noid/model.rb,
lib/active_fedora/noid/rspec.rb,
lib/active_fedora/noid/config.rb,
lib/active_fedora/noid/engine.rb,
lib/active_fedora/noid/service.rb,
lib/active_fedora/noid/version.rb,
lib/active_fedora/noid/minter/db.rb,
lib/active_fedora/noid/minter/base.rb,
lib/active_fedora/noid/minter/file.rb,
lib/generators/active_fedora/noid/seed_generator.rb,
lib/generators/active_fedora/noid/install_generator.rb

Defined Under Namespace

Modules: Minter, Model, RSpec Classes: Config, Engine, InstallGenerator, SeedGenerator, Service

Constant Summary collapse

VERSION =
'2.2.0'

Class Method Summary collapse

Class Method Details

.configObject


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

def config
  @config ||= Config.new
end

.configure {|config| ... } ⇒ Object

Yields:


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

def configure
  yield config
end

.treeify(identifier) ⇒ Object

Raises:

  • (ArgumentError)

20
21
22
23
24
25
# File 'lib/active_fedora/noid.rb', line 20

def treeify(identifier)
  raise ArgumentError, 'Identifier must be a string of size > 0 in order to be treeified' if identifier.blank?
  head = identifier.split('/').first
  head.gsub!(/#.*/, '')
  (head.scan(/..?/).first(4) + [identifier]).join('/')
end