Class: Drudgery::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/drudgery/manager.rb

Instance Method Summary collapse

Constructor Details

#initializeManager

Returns a new instance of Manager.



3
4
5
# File 'lib/drudgery/manager.rb', line 3

def initialize
  @jobs = []
end

Instance Method Details

#prepare(job = Drudgery::Job.new) {|job| ... } ⇒ Object

Yields:

  • (job)


7
8
9
10
11
# File 'lib/drudgery/manager.rb', line 7

def prepare(job=Drudgery::Job.new)
  yield job if block_given?

  @jobs << job
end

#runObject



13
14
15
# File 'lib/drudgery/manager.rb', line 13

def run
  @jobs.each { |job| job.perform }
end