Class: PauseNode

Inherits:
Node
  • Object
show all
Defined in:
lib/nodes/stmtnodes.rb

Instance Attribute Summary

Attributes inherited from Node

#value

Instance Method Summary collapse

Methods inherited from Node

#to_s

Constructor Details

#initialize(value) ⇒ PauseNode

Returns a new instance of PauseNode.



198
199
200
# File 'lib/nodes/stmtnodes.rb', line 198

def initialize(value)
  super(value)
end

Instance Method Details

#evaluateObject



202
203
204
205
# File 'lib/nodes/stmtnodes.rb', line 202

def evaluate
  @value = 0 if @value.evaluate.negative?
  sleep @value.evaluate
end