Class: Hydra::RemoteIdentifier::Registration

Inherits:
Object
  • Object
show all
Defined in:
lib/hydra/remote_identifier/registration.rb

Overview

The Registration is responsible for connecting a RemoteService and a Target to a particular Map

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(remote_service, minting_coordinator = MintingCoordinator, &map) ⇒ Registration

Returns a new instance of Registration.



11
12
13
14
# File 'lib/hydra/remote_identifier/registration.rb', line 11

def initialize(remote_service, minting_coordinator = MintingCoordinator, &map)
  @remote_service = remote_service
  @minting_coordinator = minting_coordinator
end

Instance Attribute Details

#minting_coordinatorObject (readonly)

Returns the value of attribute minting_coordinator.



10
11
12
# File 'lib/hydra/remote_identifier/registration.rb', line 10

def minting_coordinator
  @minting_coordinator
end

#remote_serviceObject (readonly)

Returns the value of attribute remote_service.



10
11
12
# File 'lib/hydra/remote_identifier/registration.rb', line 10

def remote_service
  @remote_service
end

Instance Method Details

#register(*target_classes) {|map| ... } ⇒ Object

Parameters:

  • target_classes (Array)

Yield Parameters:

  • map (Map)


18
19
20
21
22
23
24
25
# File 'lib/hydra/remote_identifier/registration.rb', line 18

def register(*target_classes, &map)
  if map.nil?
    raise RuntimeError, "You attempted to register the remote service #{remote_service} for #{target_classes} without a map"
  end
  Array(target_classes).flatten.compact.each {|target_class|
    register_target(target_class, &map)
  }
end