Class: Couchbase::SearchSort::SearchSortId

Inherits:
Couchbase::SearchSort show all
Defined in:
lib/couchbase/search_options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Couchbase::SearchSort

field, geo_distance, id, score

Constructor Details

#initialize {|| ... } ⇒ SearchSortId

Returns a new instance of SearchSortId.

Yield Parameters:



1181
1182
1183
1184
# File 'lib/couchbase/search_options.rb', line 1181

def initialize
  super
  yield self if block_given?
end

Instance Attribute Details

#descBoolean

Returns if descending order should be applied.

Returns:

  • (Boolean)

    if descending order should be applied



1178
1179
1180
# File 'lib/couchbase/search_options.rb', line 1178

def desc
  @desc
end

Instance Method Details

#to_json(*args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



1187
1188
1189
# File 'lib/couchbase/search_options.rb', line 1187

def to_json(*args)
  {by: :id, desc: desc}.to_json(*args)
end