Class: AddNode
- Inherits:
-
BinaryNode
- Object
- BinaryNode
- AddNode
- Defined in:
- lib/ast.rb
Overview
Operaciones Suma, Resta, Multiplicacion, Division y Modulo
Instance Attribute Summary
Attributes inherited from BinaryNode
Instance Method Summary collapse
- #evaluate ⇒ Object
-
#initialize(left, right) ⇒ AddNode
constructor
A new instance of AddNode.
Constructor Details
#initialize(left, right) ⇒ AddNode
Returns a new instance of AddNode.
23 24 25 |
# File 'lib/ast.rb', line 23 def initialize(left, right) super(left,right) # Llama o recibe los atributos del padre end |
Instance Method Details
#evaluate ⇒ Object
27 28 29 |
# File 'lib/ast.rb', line 27 def evaluate() return @left.evaluate() + @right.evaluate() #No es necesario el "Return" end |