Class: PromptCloudTimer

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

Instance Method Summary collapse

Constructor Details

#initialize(args_hash = {}) ⇒ PromptCloudTimer

Returns a new instance of PromptCloudTimer.


256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/promptcloud_data_api.rb', line 256

def initialize(args_hash={})
	super()
	if args_hash[:min]
		@min=args_hash[:min]
	else
		@min=10
	end

	if args_hash[:max]
		@max=args_hash[:max]
	else
		@max=300
	end
	@sleep_interval=@min
end

Instance Method Details

#waitObject


272
273
274
275
276
277
278
279
# File 'lib/promptcloud_data_api.rb', line 272

def wait
	$stderr.puts "Going to sleep for #{@sleep_interval} seconds"
	sleep(@sleep_interval)
	@sleep_interval *=2 
	if @sleep_interval > 300
		@sleep_interval=10
	end
end