Class: Hydra::RemoteIdentifier::MintingCoordinator

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

Overview

The Minting

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(remote_service, mapper_builder = Mapper, &map_config) ⇒ MintingCoordinator

Returns a new instance of MintingCoordinator.



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

def initialize(remote_service, mapper_builder = Mapper, &map_config)
  @remote_service = remote_service
  @mapper = mapper_builder.new(remote_service, &map_config)
end

Instance Attribute Details

#mapperObject (readonly)

Returns the value of attribute mapper.



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

def mapper
  @mapper
end

#remote_serviceObject (readonly)

Returns the value of attribute remote_service.



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

def remote_service
  @remote_service
end

Instance Method Details

#call(target, minter = Minter) ⇒ Object

Responsible for passing attributes from the target, as per the map, to the service and assigning the result of the service to the target, as per the map.



17
18
19
# File 'lib/hydra/remote_identifier/minting_coordinator.rb', line 17

def call(target, minter = Minter)
  minter.call(remote_service, wrap(target))
end