Class: TPPlus::Nodes::TimerNode
- Inherits:
-
Object
- Object
- TPPlus::Nodes::TimerNode
- Defined in:
- lib/tp_plus/nodes/timer_node.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
Returns the value of attribute comment.
Instance Method Summary collapse
- #comment_string ⇒ Object
- #eval(context, options = {}) ⇒ Object
-
#initialize(id) ⇒ TimerNode
constructor
A new instance of TimerNode.
Constructor Details
#initialize(id) ⇒ TimerNode
Returns a new instance of TimerNode.
5 6 7 8 |
# File 'lib/tp_plus/nodes/timer_node.rb', line 5 def initialize(id) @id = id @comment = "" end |
Instance Attribute Details
#comment ⇒ Object
Returns the value of attribute comment.
4 5 6 |
# File 'lib/tp_plus/nodes/timer_node.rb', line 4 def comment @comment end |
Instance Method Details
#comment_string ⇒ Object
10 11 12 13 14 |
# File 'lib/tp_plus/nodes/timer_node.rb', line 10 def comment_string return "" if @comment == "" ":#{comment}" end |
#eval(context, options = {}) ⇒ Object
16 17 18 |
# File 'lib/tp_plus/nodes/timer_node.rb', line 16 def eval(context, ={}) "TIMER[#{@id}#{comment_string}]" end |