Class: Drudgery::Manager
- Inherits:
-
Object
- Object
- Drudgery::Manager
- Defined in:
- lib/drudgery/manager.rb
Instance Method Summary collapse
-
#initialize ⇒ Manager
constructor
A new instance of Manager.
- #prepare(job = Drudgery::Job.new) {|job| ... } ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize ⇒ Manager
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
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 |
#run ⇒ Object
13 14 15 |
# File 'lib/drudgery/manager.rb', line 13 def run @jobs.each { |job| job.perform } end |