Class: Heimdall::Worker

Inherits:
Object show all
Defined in:
lib/heimdall/heimdall_worker.rb

Direct Known Subclasses

HeimdallProxyWorker

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWorker

Returns a new instance of Worker.



36
37
38
# File 'lib/heimdall/heimdall_worker.rb', line 36

def initialize
  @_log = []
end

Class Method Details

.call(opts = {}) ⇒ Object Also known as: perform



28
29
30
# File 'lib/heimdall/heimdall_worker.rb', line 28

def call opts = {}
  Heimdall.add self, opts.to_hwia
end

Instance Method Details

#log(text = nil) ⇒ Object



40
41
42
43
44
45
46
47
# File 'lib/heimdall/heimdall_worker.rb', line 40

def log text = nil
  if text
    @_log.push text
    text
  else
    @_log.join $/
  end
end