Class: ElseifNode
Instance Attribute Summary collapse
-
#argument ⇒ Object
Returns the value of attribute argument.
Attributes inherited from Node
Instance Method Summary collapse
- #create_tree_entry ⇒ Object
- #evaluate ⇒ Object
-
#initialize(argument, node) ⇒ ElseifNode
constructor
A new instance of ElseifNode.
- #to_s ⇒ Object
Constructor Details
#initialize(argument, node) ⇒ ElseifNode
Returns a new instance of ElseifNode.
186 187 188 |
# File 'lib/nodes/stmtnodes.rb', line 186 def initialize(argument, node) @argument, @node = argument, node end |
Instance Attribute Details
#argument ⇒ Object
Returns the value of attribute argument.
184 185 186 |
# File 'lib/nodes/stmtnodes.rb', line 184 def argument @argument end |
Instance Method Details
#create_tree_entry ⇒ Object
194 195 196 197 198 |
# File 'lib/nodes/stmtnodes.rb', line 194 def create_tree_entry result = set_up_scope_header result += "Elseif statement is used. #{@argument}" TREE_ARRAY << result unless TREE_ARRAY[-1] == result end |
#evaluate ⇒ Object
200 201 202 203 204 |
# File 'lib/nodes/stmtnodes.rb', line 200 def evaluate @value = @node.evaluate create_tree_entry if PRINT_TREE_FLAG @value end |
#to_s ⇒ Object
190 191 192 |
# File 'lib/nodes/stmtnodes.rb', line 190 def to_s 'Else' end |