Class: Sunspot::Query::Sort::FunctionSort

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

Overview

A FunctionSort sorts by solr function. FunctionComp recursively parses arguments for nesting

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(setup, args) ⇒ FunctionSort

Returns a new instance of FunctionSort.



124
125
126
127
# File 'lib/sunspot/query/sort.rb', line 124

def initialize(setup,args)
  @direction = args.pop
  @comp = FunctionComp.new(setup,args)
end

Instance Attribute Details

#compObject (readonly)

Returns the value of attribute comp.



123
124
125
# File 'lib/sunspot/query/sort.rb', line 123

def comp
  @comp
end

Instance Method Details

#to_paramObject



128
129
130
# File 'lib/sunspot/query/sort.rb', line 128

def to_param
  "#{comp.to_s} #{direction_for_solr}"
end