Class: Hydra::RemoteIdentifier::RemoteService
- Inherits:
-
Object
- Object
- Hydra::RemoteIdentifier::RemoteService
- Defined in:
- lib/hydra/remote_identifier/remote_service.rb
Overview
The RemoteService is responsible for delivering a payload to a remote identification minting service and returning an identifier.
It is responsible for assisting the construction and validation of a remote payload.
Direct Known Subclasses
Instance Method Summary collapse
-
#accessor_name ⇒ Object
When mapping a Target to a RemoteService, this is the name of the :attr_accessor that will be created on the Target; Helpful for form construction.
-
#call(payload) ⇒ Object
-
The remote identifier that was created.
-
- #name ⇒ Object
- #remote_uri_for(identifier) ⇒ Object
- #to_s ⇒ Object
- #valid_attribute?(attribute_name) ⇒ Boolean
Instance Method Details
#accessor_name ⇒ Object
When mapping a Target to a RemoteService, this is the name of the :attr_accessor that will be created on the Target; Helpful for form construction.
32 33 34 |
# File 'lib/hydra/remote_identifier/remote_service.rb', line 32 def accessor_name "mint_#{name}".to_sym end |
#call(payload) ⇒ Object
Returns - The remote identifier that was created.
51 52 53 54 |
# File 'lib/hydra/remote_identifier/remote_service.rb', line 51 def call(payload) raise NotImplementedError, "You must implement #{self.class}#call" end |
#name ⇒ Object
11 12 13 |
# File 'lib/hydra/remote_identifier/remote_service.rb', line 11 def name self.class.to_s.demodulize.underscore.to_sym end |
#remote_uri_for(identifier) ⇒ Object
22 23 24 25 |
# File 'lib/hydra/remote_identifier/remote_service.rb', line 22 def remote_uri_for(identifier) raise NotImplementedError, "You must implement #{self.class}#remote_uri_for(identifier)" end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/hydra/remote_identifier/remote_service.rb', line 15 def to_s name.to_s end |
#valid_attribute?(attribute_name) ⇒ Boolean
40 41 42 43 |
# File 'lib/hydra/remote_identifier/remote_service.rb', line 40 def valid_attribute?(attribute_name) raise NotImplementedError, "You must implement #{self.class}#valid_attribute?" end |