Method: Idler::Workers#add_worker

Defined in:
lib/idler/workers.rb

#add_worker(branch_name = nil, block = nil) ⇒ Object



13
14
15
16
17
18
# File 'lib/idler/workers.rb', line 13

def add_worker(branch_name = nil, block = nil)
  raise NothingBranchNameError if branch_name.nil?
  raise NotYetAddBranchError   unless @workers.key?(branch_name)
  raise NotProcError           unless block.class == Proc
  @workers[branch_name] = block
end