Class: Scrubber::Worker

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWorker

Returns a new instance of Worker.



5
6
7
# File 'lib/scrubber/worker.rb', line 5

def initialize
  @jobs = [] 
end

Instance Attribute Details

#jobsObject (readonly)

Returns the value of attribute jobs.



3
4
5
# File 'lib/scrubber/worker.rb', line 3

def jobs
  @jobs
end

Instance Method Details

#performObject



14
15
16
# File 'lib/scrubber/worker.rb', line 14

def perform
  @jobs.each{|j| j.perform}
end

#scrub_table(table_name, options = {}) {|@jobs.last| ... } ⇒ Object

Yields:



9
10
11
12
# File 'lib/scrubber/worker.rb', line 9

def scrub_table(table_name, options = {})
  @jobs << Scrubber::Job.new(table_name, options)
  yield(@jobs.last)
end