Class: Couchbase::SearchSort::SearchSortGeoDistance
- Inherits:
-
Couchbase::SearchSort
- Object
- Couchbase::SearchSort
- Couchbase::SearchSort::SearchSortGeoDistance
- Defined in:
- lib/couchbase/search_options.rb,
/code/couchbase-ruby-client/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.
- #latitude ⇒ Float readonly
- #longitude ⇒ Float readonly
- #unit ⇒ :meters, ...
Instance Method Summary collapse
-
#initialize(field, longitude, latitude) {|| ... } ⇒ SearchSortGeoDistance
constructor
A new instance of SearchSortGeoDistance.
Methods inherited from Couchbase::SearchSort
field, geo_distance, id, score
Constructor Details
#initialize(field, longitude, latitude) {|| ... } ⇒ SearchSortGeoDistance
Returns a new instance of SearchSortGeoDistance.
1242 1243 1244 1245 1246 1247 1248 |
# File 'lib/couchbase/search_options.rb', line 1242 def initialize(field, longitude, latitude) super() @field = field @longitude = longitude @latitude = latitude yield self if block_given? end |
Instance Attribute Details
#desc ⇒ Boolean
Returns if descending order should be applied.
1227 1228 1229 |
# File 'lib/couchbase/search_options.rb', line 1227 def desc @desc end |
#field ⇒ String (readonly)
Returns name of the field to sort by.
1224 1225 1226 |
# File 'lib/couchbase/search_options.rb', line 1224 def field @field end |
#latitude ⇒ Float (readonly)
1233 1234 1235 |
# File 'lib/couchbase/search_options.rb', line 1233 def latitude @latitude end |
#longitude ⇒ Float (readonly)
1230 1231 1232 |
# File 'lib/couchbase/search_options.rb', line 1230 def longitude @longitude end |
#unit ⇒ :meters, ...
1236 1237 1238 |
# File 'lib/couchbase/search_options.rb', line 1236 def unit @unit end |