class GearedPagination::PortionAtCursor::Match

Attributes

head[R]
tail[R]

Public Class Methods

new(head, tail) click to toggle source
# File lib/geared_pagination/portions/portion_at_cursor.rb, line 87
def initialize(head, tail)
  @head, @tail = head, tail
end

Public Instance Methods

condition_on(table, cursor) click to toggle source
# File lib/geared_pagination/portions/portion_at_cursor.rb, line 91
def condition_on(table, cursor)
  conditions_on(table, cursor).reduce { |left, right| left.and(right) }
end

Private Instance Methods

conditions_on(table, cursor) click to toggle source
# File lib/geared_pagination/portions/portion_at_cursor.rb, line 96
def conditions_on(table, cursor)
  predicates.collect { |predicate| predicate.condition_on(table, cursor.fetch(predicate.attribute)) }
end
predicates() click to toggle source
# File lib/geared_pagination/portions/portion_at_cursor.rb, line 100
def predicates
  tail.collect { |order| Equal.new(order) }.including(Inequal.new(head))
end