Class: Hydra::RemoteIdentifier::Registration
- Inherits:
-
Object
- Object
- Hydra::RemoteIdentifier::Registration
- 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
-
#minting_coordinator ⇒ Object
readonly
Returns the value of attribute minting_coordinator.
-
#remote_service ⇒ Object
readonly
Returns the value of attribute remote_service.
Instance Method Summary collapse
-
#initialize(remote_service, minting_coordinator = MintingCoordinator, &map) ⇒ Registration
constructor
A new instance of Registration.
- #register(*target_classes) {|map| ... } ⇒ Object
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_coordinator ⇒ Object (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_service ⇒ Object (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
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 |