Method: BOAST::Expression#to_str

Defined in:
lib/BOAST/Algorithm.rb

#to_strObject



315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/BOAST/Algorithm.rb', line 315

def to_str
  op1 = nil
  op1 = @operand1.to_var if @operand1.respond_to?(:to_var)
  op2 = nil
  op2 = @operand2.to_var if @operand2.respond_to?(:to_var)
  r_t = nil
  if op1 and op2 then
    r_t, oper = BOAST::transition(op1, op2, @operator)
  else
    oper = @operator
  end

  op1 = @operand1 if op1.nil?
  op2 = @operand2 if op2.nil?

  return BOAST::Expression::to_str_base(op1, op2, oper, r_t)
end