class Axiom::Optimizer::Relation::Operation::Reverse::SortedOperand

Optimize when the operand is an Sorted

Public Instance Methods

optimizable?() click to toggle source

Test if the operand is an Sorted

@return [Boolean]

@api private

# File lib/axiom/optimizer/relation/operation/reverse.rb, line 42
def optimizable?
  operand.kind_of?(Axiom::Relation::Operation::Sorted)
end
optimize() click to toggle source

Flatten Reverse operation and Sorted operand into an Sorted

@return [Sorted]

@api private

# File lib/axiom/optimizer/relation/operation/reverse.rb, line 51
def optimize
  operand.operand.sort_by { operation.directions }
end