Class: ElseNode

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

Instance Attribute Summary collapse

Attributes inherited from Node

#value

Instance Method Summary collapse

Methods inherited from Node

#to_s

Constructor Details

#initialize(node) ⇒ ElseNode

Returns a new instance of ElseNode.



131
132
133
134
# File 'lib/nodes/stmtnodes.rb', line 131

def initialize(node)
  @node = node
  @argument = BoolNode.new(ScopeManager.true_value)
end

Instance Attribute Details

#argumentObject

Returns the value of attribute argument.



129
130
131
# File 'lib/nodes/stmtnodes.rb', line 129

def argument
  @argument
end

#nodeObject

Returns the value of attribute node.



129
130
131
# File 'lib/nodes/stmtnodes.rb', line 129

def node
  @node
end

Instance Method Details

#evaluateObject



136
137
138
# File 'lib/nodes/stmtnodes.rb', line 136

def evaluate
  @value = @node.evaluate
end