Class: Script::Interval
- Inherits:
-
Object
- Object
- Script::Interval
- Defined in:
- lib/script.rb
Overview
in Trigger
Instance Method Summary collapse
- #doit ⇒ Object
-
#initialize(toplevel, n, &block) ⇒ Interval
constructor
A new instance of Interval.
Constructor Details
#initialize(toplevel, n, &block) ⇒ Interval
Returns a new instance of Interval.
63 64 65 66 67 68 |
# File 'lib/script.rb', line 63 def initialize(toplevel, n, &block) @toplevel = toplevel @n = n @m = 0 @prog = Prog.new(@toplevel, &block) end |
Instance Method Details
#doit ⇒ Object
70 71 72 73 74 75 76 |
# File 'lib/script.rb', line 70 def doit @m += 1 if @m == @n @prog.doit @m = 0 end end |