module Axiom::Optimizer::Function::Unary::ConstantOperand

Optimize when the operand is constant

Public Instance Methods

optimizable?() click to toggle source

Test if the operand is constant

@return [Boolean]

@api private

# File lib/axiom/optimizer/function/unary.rb, line 46
def optimizable?
  Util.constant?(operand)
end
optimize() click to toggle source

Evaluate the operand and return the constant

@return [Object]

@api private

# File lib/axiom/optimizer/function/unary.rb, line 55
def optimize
  operation.class.call(operand)
end