# File default/rent_a_jobber.rb, line 43 def task() # advert() rich = RentAJobber.new() # rich.add_action(Proc.new do advert() end) rich.add_action(method(:advert) ) worker = UrRobot.new(1, 1, NORTH, 1) task = worker.method(:move) rich.add_action(task) # add a method bound to worker task = worker.method(:turn_left) rich.add_action(task) worker = UrRobot.new(1, 2, NORTH, 0) task = worker.method(:move) rich.add_action(task) # add methods bound to a different rich.add_action(task) # worker # worker.turn_off() task_list = rich.rent() task_list.each do |what| what.call() end # do_all(task_list) end