Class: PrintNode
- Inherits:
-
Object
- Object
- PrintNode
- Defined in:
- lib/nodes/stmtnodes.rb
Overview
Built-in Functions
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #evaluate ⇒ Object
-
#initialize(value) ⇒ PrintNode
constructor
A new instance of PrintNode.
Constructor Details
#initialize(value) ⇒ PrintNode
Returns a new instance of PrintNode.
179 180 181 |
# File 'lib/nodes/stmtnodes.rb', line 179 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
177 178 179 |
# File 'lib/nodes/stmtnodes.rb', line 177 def value @value end |
Instance Method Details
#evaluate ⇒ Object
183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/nodes/stmtnodes.rb', line 183 def evaluate if @value.evaluate.is_a?(ArrayNode) print "Array #{@value.name}: " unless TEST_UNIT_ACTIVE puts @value.evaluate unless TEST_UNIT_ACTIVE elsif @value.evaluate.is_a?(Array) print "Array #{@value.name}: " unless TEST_UNIT_ACTIVE puts @value.evaluate.join(', ') unless TEST_UNIT_ACTIVE else puts @value.evaluate unless TEST_UNIT_ACTIVE end self.class end |