Class: Hydra::RemoteIdentifier::RemoteService
- Inherits:
-
Object
- Object
- Hydra::RemoteIdentifier::RemoteService
show all
- 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.
Instance Method Summary
collapse
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.
41
42
43
|
# File 'lib/hydra/remote_identifier/remote_service.rb', line 41
def accessor_name
"mint_#{name}".to_sym
end
|
#call(payload) ⇒ Object
Returns - The remote identifier that was created.
60
61
62
63
|
# File 'lib/hydra/remote_identifier/remote_service.rb', line 60
def call(payload)
raise NotImplementedError,
"You must implement #{self.class}#call"
end
|
#mint(target) ⇒ Object
24
25
26
|
# File 'lib/hydra/remote_identifier/remote_service.rb', line 24
def mint(target)
Hydra::RemoteIdentifier.mint(self, target)
end
|
#name ⇒ Object
12
13
14
|
# File 'lib/hydra/remote_identifier/remote_service.rb', line 12
def name
self.class.to_s.demodulize.underscore.to_sym
end
|
#registered?(target) ⇒ Boolean
#remote_uri_for(identifier) ⇒ Object
31
32
33
34
|
# File 'lib/hydra/remote_identifier/remote_service.rb', line 31
def remote_uri_for(identifier)
raise NotImplementedError,
"You must implement #{self.class}#remote_uri_for(identifier)"
end
|
#to_s ⇒ Object
16
17
18
|
# File 'lib/hydra/remote_identifier/remote_service.rb', line 16
def to_s
name.to_s
end
|
#valid_attribute?(attribute_name) ⇒ Boolean
49
50
51
52
|
# File 'lib/hydra/remote_identifier/remote_service.rb', line 49
def valid_attribute?(attribute_name)
raise NotImplementedError,
"You must implement #{self.class}#valid_attribute?"
end
|