Class: IfNode

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

Overview

If Statement Nodes

Instance Attribute Summary collapse

Attributes inherited from Node

#value

Instance Method Summary collapse

Methods inherited from Node

#to_s

Constructor Details

#initialize(argument, node) ⇒ IfNode

Returns a new instance of IfNode.



107
108
109
# File 'lib/nodes/stmtnodes.rb', line 107

def initialize(argument, node)
  @argument, @node = argument, node
end

Instance Attribute Details

#argumentObject

Returns the value of attribute argument.



105
106
107
# File 'lib/nodes/stmtnodes.rb', line 105

def argument
  @argument
end

Instance Method Details

#evaluateObject



111
112
113
# File 'lib/nodes/stmtnodes.rb', line 111

def evaluate
  @value = @node.evaluate
end