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.
40
41
42
|
# File 'lib/hydra/remote_identifier/remote_service.rb', line 40
def accessor_name
"mint_#{name}".to_sym
end
|
#call(payload) ⇒ Object
Returns - The remote identifier that was created.
59
60
61
62
|
# File 'lib/hydra/remote_identifier/remote_service.rb', line 59
def call(payload)
raise NotImplementedError,
"You must implement #{self.class}#call"
end
|
#mint(target) ⇒ Object
23
24
25
|
# File 'lib/hydra/remote_identifier/remote_service.rb', line 23
def mint(target)
Hydra::RemoteIdentifier.mint(self, target)
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
|
#registered?(target) ⇒ Boolean
#remote_uri_for(identifier) ⇒ Object
30
31
32
33
|
# File 'lib/hydra/remote_identifier/remote_service.rb', line 30
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
48
49
50
51
|
# File 'lib/hydra/remote_identifier/remote_service.rb', line 48
def valid_attribute?(attribute_name)
raise NotImplementedError,
"You must implement #{self.class}#valid_attribute?"
end
|