Class: Solr::Query::Request::Sorting

Inherits:
Object
  • Object
show all
Defined in:
lib/solr/query/request/sorting.rb,
lib/solr/query/request/sorting/field.rb,
lib/solr/query/request/sorting/function.rb

Defined Under Namespace

Classes: Field, Function, None

Constant Summary collapse

ASC =
:asc
DESC =
:desc

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fields: []) ⇒ Sorting

Returns a new instance of Sorting.



23
24
25
26
# File 'lib/solr/query/request/sorting.rb', line 23

def initialize(fields: [])
  @fields = fields
  freeze
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



17
18
19
# File 'lib/solr/query/request/sorting.rb', line 17

def fields
  @fields
end

Class Method Details

.noneObject



19
20
21
# File 'lib/solr/query/request/sorting.rb', line 19

def self.none
  None.new
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/solr/query/request/sorting.rb', line 28

def empty?
  fields.empty?
end