Class: Wurk::Worker::JobsView

Inherits:
Array
  • Object
show all
Defined in:
lib/wurk/worker.rb

Overview

What MyJob.jobs returns. Queues indexes by queue and groups by class on read, so the rows are a fresh Array; #clear still has to reach the store, because MyJob.jobs.clear is the documented way to reset a class between tests. Other in-place mutators stay local to this copy.

Instance Method Summary collapse

Constructor Details

#initialize(klass, rows) ⇒ JobsView

Returns a new instance of JobsView.



110
111
112
113
# File 'lib/wurk/worker.rb', line 110

def initialize(klass, rows)
  super(rows)
  @klass = klass
end

Instance Method Details

#clear ⇒ Object



115
116
117
118
# File 'lib/wurk/worker.rb', line 115

def clear
  ::Wurk::Queues.clear_class(@klass)
  super
end