Module: IronWorker::TestService::Schedule

Defined in:
lib/iron_cuke/test_service.rb

Instance Method Summary collapse

Instance Method Details

#cancel_schedule(scheduled_task_id, options = {}) ⇒ Object



21
22
23
24
# File 'lib/iron_cuke/test_service.rb', line 21

def cancel_schedule(scheduled_task_id, options={})
	raise "Must include a schedule id." if scheduled_task_id.blank?
	IronCuke.cancel_schedule(scheduled_task_id)
end

#schedule(name, data, options) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/iron_cuke/test_service.rb', line 12

def schedule(name, data, options)
	worker = name.classify.constantize.new
	variables = JSON.parse(Base64.decode64(data[:attr_encoded])) if data[:attr_encoded].present?
	variables.each do |k, v|
		worker.instance_variable_set(k.to_sym, v)
	end
	IronCuke.schedule(worker, options)
end