Class: Hydra::RemoteIdentifier::Minter

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

Overview

The Minter is responsible for passing the target’s payload to the RemoteService then setting the target’s identifier based on the response from the remote_service

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service, target) ⇒ Minter

Returns a new instance of Minter.



15
16
17
# File 'lib/hydra/remote_identifier/minter.rb', line 15

def initialize(service, target)
  @service, @target = service, target
end

Instance Attribute Details

#serviceObject (readonly)

Returns the value of attribute service.



13
14
15
# File 'lib/hydra/remote_identifier/minter.rb', line 13

def service
  @service
end

#targetObject (readonly)

Returns the value of attribute target.



13
14
15
# File 'lib/hydra/remote_identifier/minter.rb', line 13

def target
  @target
end

Class Method Details

.call(coordinator, target) ⇒ Object



9
10
11
# File 'lib/hydra/remote_identifier/minter.rb', line 9

def self.call(coordinator, target)
  new(coordinator, target).call
end

Instance Method Details

#callObject



19
20
21
# File 'lib/hydra/remote_identifier/minter.rb', line 19

def call
  update_target(service.call(payload))
end