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.



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

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

Instance Attribute Details

#serviceObject (readonly)

Returns the value of attribute service.



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

def service
  @service
end

#targetObject (readonly)

Returns the value of attribute target.



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

def target
  @target
end

Class Method Details

.call(coordinator, target) ⇒ Object



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

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

Instance Method Details

#callObject



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

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