class Axiom::Optimizer::Function::Predicate::Comparable::NormalizableOperands
Optimize when the operands can be normalized
Public Instance Methods
optimizable?()
click to toggle source
Test if the operands can be normalized
@return [Boolean]
@api private
# File lib/axiom/optimizer/function/predicate/comparable.rb, line 19 def optimizable? util = Util util.constant?(left) && util.attribute?(right) end
optimize()
click to toggle source
Normalize the predicate by reversing the operands
@return [Predicate]
@api private
# File lib/axiom/optimizer/function/predicate/comparable.rb, line 29 def optimize operation.class.reverse.new(right, left) end