Class: Couchbase::SearchSort::SearchSortField
- Inherits:
-
Couchbase::SearchSort
- Object
- Couchbase::SearchSort
- Couchbase::SearchSort::SearchSortField
- Defined in:
- lib/couchbase/search_options.rb
Instance Attribute Summary collapse
-
#desc ⇒ Boolean
If descending order should be applied.
-
#field ⇒ String
readonly
Name of the field to sort by.
-
#missing ⇒ :first, :last
Where the documents with missing field should be placed.
- #mode ⇒ :default, ...
- #type ⇒ :auto, ...
Instance Method Summary collapse
-
#initialize(field) {|| ... } ⇒ SearchSortField
constructor
A new instance of SearchSortField.
- #to_json(*args) ⇒ Object private
Methods inherited from Couchbase::SearchSort
field, geo_distance, id, score
Constructor Details
#initialize(field) {|| ... } ⇒ SearchSortField
Returns a new instance of SearchSortField.
1182 1183 1184 1185 1186 |
# File 'lib/couchbase/search_options.rb', line 1182 def initialize(field) super() @field = field yield self if block_given? end |
Instance Attribute Details
#desc ⇒ Boolean
Returns if descending order should be applied.
1169 1170 1171 |
# File 'lib/couchbase/search_options.rb', line 1169 def desc @desc end |
#field ⇒ String (readonly)
Returns name of the field to sort by.
1166 1167 1168 |
# File 'lib/couchbase/search_options.rb', line 1166 def field @field end |
#missing ⇒ :first, :last
Returns where the documents with missing field should be placed.
1175 1176 1177 |
# File 'lib/couchbase/search_options.rb', line 1175 def missing @missing end |
#mode ⇒ :default, ...
1178 1179 1180 |
# File 'lib/couchbase/search_options.rb', line 1178 def mode @mode end |
#type ⇒ :auto, ...
1172 1173 1174 |
# File 'lib/couchbase/search_options.rb', line 1172 def type @type 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.
1189 1190 1191 |
# File 'lib/couchbase/search_options.rb', line 1189 def to_json(*args) {by: :field, field: field, desc: desc, type: type, missing: missing, mode: mode}.to_json(*args) end |