Class: Sunspot::Query::Sort::Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/sunspot/query/sort.rb

Overview

Base class for sorts. All subclasses should implement the #to_param method, which is a string that is then concatenated with other sort strings by the SortComposite to form the sort parameter.

Direct Known Subclasses

FieldSort, FunctionSort, RandomSort, ScoreSort

Instance Method Summary collapse

Constructor Details

#initialize(direction) ⇒ Abstract

Returns a new instance of Abstract.



39
40
41
# File 'lib/sunspot/query/sort.rb', line 39

def initialize(direction)
  @direction = (direction || :asc).to_sym
end