Class: Romanesco::Operand

Inherits:
Expression show all
Defined in:
lib/romanesco/elements/operand.rb

Direct Known Subclasses

ConstantOperand, VariableOperand

Instance Attribute Summary

Attributes inherited from Expression

#parent

Instance Method Summary collapse

Methods inherited from Expression

#evaluate, #initialize

Constructor Details

This class inherits a constructor from Romanesco::Expression

Instance Method Details

#connect(last_operator, last_operand) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/romanesco/elements/operand.rb', line 6

def connect(last_operator, last_operand)
  if last_operator && last_operator.is_a?(BinaryOperator) && last_operator.left_operand
    last_operator.insert_element_to_right(self)
  elsif last_operator
    last_operator.insert_element_to_right(self)
  end
end