class Axiom::Optimizer::Relation::Operation::Offset::OffsetOperand
Optimize when the operand is an Offset
Public Instance Methods
optimizable?()
click to toggle source
Test if the operand is an Offset
@return [Boolean]
@api private
# File lib/axiom/optimizer/relation/operation/offset.rb, line 53 def optimizable? operand.kind_of?(operation.class) end
optimize()
click to toggle source
Flatten Offset
operations using the sum of the offsets
@return [Boolean]
@api private
# File lib/axiom/optimizer/relation/operation/offset.rb, line 62 def optimize operand.operand.drop(sum_offset) end
Private Instance Methods
sum_offset()
click to toggle source
Return the sum of the operation and operand offsets
@return [Integer]
@api private
# File lib/axiom/optimizer/relation/operation/offset.rb, line 73 def sum_offset offset + operand.offset end