Class: TPPlus::Nodes::StringRegisterNode

Inherits:
Object
  • Object
show all
Defined in:
lib/tp_plus/nodes/string_register_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ StringRegisterNode

Returns a new instance of StringRegisterNode.



6
7
8
9
# File 'lib/tp_plus/nodes/string_register_node.rb', line 6

def initialize(id)
  @id = id
  @comment = ""
end

Instance Attribute Details

#commentObject

Returns the value of attribute comment.



4
5
6
# File 'lib/tp_plus/nodes/string_register_node.rb', line 4

def comment
  @comment
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/tp_plus/nodes/string_register_node.rb', line 5

def id
  @id
end

Instance Method Details

#comment_stringObject



15
16
17
18
19
# File 'lib/tp_plus/nodes/string_register_node.rb', line 15

def comment_string
  return "" if @comment == ""

  ":#{@comment}"
end

#eval(context, options = {}) ⇒ Object



21
22
23
# File 'lib/tp_plus/nodes/string_register_node.rb', line 21

def eval(context,options={})
  "SR[#{@id}#{comment_string}]"
end

#requires_mixed_logic?(context) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/tp_plus/nodes/string_register_node.rb', line 11

def requires_mixed_logic?(context)
  false
end