class Pagy::Keyset::Sequel

def extract_keyset

Extract the keyset from the set
def extract_keyset
  return {} unless @set.opts[:order]
  @set.opts[:order].each_with_object({}) do |item, keyset|
    case item
    when Symbol
      keyset[item] = :asc
    when ::Sequel::SQL::OrderedExpression
      keyset[item.expression] = item.descending ? :desc : :asc
    else
      raise TypeError, "#{item.class.inspect} is not a supported Sequel::SQL::OrderedExpression"
    end
  end
end