Class: Interval
- Inherits:
-
Object
- Object
- Interval
- Defined in:
- lib/red_query/interval.rb
Instance Method Summary collapse
- #clear ⇒ Object
-
#initialize(time, &block) ⇒ Interval
constructor
A new instance of Interval.
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
#clear ⇒ Object
6 7 8 |
# File 'lib/red_query/interval.rb', line 6 def clear `clearInterval(#{@timer})` end |