Class: Interval

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

Instance Method Summary collapse

Constructor Details

#initialize(time, &block) ⇒ Interval

Returns a new instance of Interval.



2
3
4
# File 'lib/red_query/interval.rb', line 2

def initialize(time, &block)
  @timer = `setInterval(function () { #{block.call} }, #{time})`
end

Instance Method Details

#clearObject



6
7
8
# File 'lib/red_query/interval.rb', line 6

def clear
  `clearInterval(#{@timer})`
end