Class: MintRemoteIdentifierWorker

Inherits:
Object
  • Object
show all
Defined in:
app/workers/mint_remote_identifier_worker.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pid, remote_service_name) ⇒ MintRemoteIdentifierWorker

Returns a new instance of MintRemoteIdentifierWorker.



11
12
13
14
# File 'app/workers/mint_remote_identifier_worker.rb', line 11

def initialize(pid, remote_service_name)
  @pid = pid
  @remote_service_name = remote_service_name
end

Instance Attribute Details

#pidObject (readonly)

Returns the value of attribute pid.



10
11
12
# File 'app/workers/mint_remote_identifier_worker.rb', line 10

def pid
  @pid
end

#remote_service_nameObject (readonly)

Returns the value of attribute remote_service_name.



10
11
12
# File 'app/workers/mint_remote_identifier_worker.rb', line 10

def remote_service_name
  @remote_service_name
end

Class Method Details

.enqueue(pid, remote_service_name) ⇒ Object



2
3
4
# File 'app/workers/mint_remote_identifier_worker.rb', line 2

def self.enqueue(pid, remote_service_name)
  Sufia.queue.push(new(pid, remote_service_name))
end

Instance Method Details

#queue_nameObject



6
7
8
# File 'app/workers/mint_remote_identifier_worker.rb', line 6

def queue_name
  :remote_identifiers
end

#runObject



16
17
18
# File 'app/workers/mint_remote_identifier_worker.rb', line 16

def run
  Hydra::RemoteIdentifier.mint(remote_service_name, target)
end