Class: GlooLang::Expr::OpMinus

Inherits:
Core::Op
  • Object
show all
Defined in:
lib/gloo_lang/expr/op_minus.rb

Instance Method Summary collapse

Methods inherited from Core::Op

create_op, default_op, op?

Instance Method Details

#perform(left, right) ⇒ Object

Perform the operation and return the result.



14
15
16
17
18
# File 'lib/gloo_lang/expr/op_minus.rb', line 14

def perform( left, right )
  return left - right.to_i if left.is_a? Integer

  return left - right.to_f if left.is_a? Numeric
end