Class: Couchbase::SearchSort::SearchSortGeoDistance

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(field, longitude, latitude) {|| ... } ⇒ SearchSortGeoDistance

Returns a new instance of SearchSortGeoDistance.

Parameters:

  • field (String)

    field name

  • longitude (Float)
  • latitude (Float)

Yield Parameters:



1214
1215
1216
1217
1218
1219
1220
# File 'lib/couchbase/search_options.rb', line 1214

def initialize(field, longitude, latitude)
  super()
  @field = field
  @longitude = longitude
  @latitude = latitude
  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



1199
1200
1201
# File 'lib/couchbase/search_options.rb', line 1199

def desc
  @desc
end

#fieldString (readonly)

Returns name of the field to sort by.

Returns:

  • (String)

    name of the field to sort by



1196
1197
1198
# File 'lib/couchbase/search_options.rb', line 1196

def field
  @field
end

#latitudeFloat (readonly)

Returns:

  • (Float)


1205
1206
1207
# File 'lib/couchbase/search_options.rb', line 1205

def latitude
  @latitude
end

#longitudeFloat (readonly)

Returns:

  • (Float)


1202
1203
1204
# File 'lib/couchbase/search_options.rb', line 1202

def longitude
  @longitude
end

#unit:meters, ...

Returns:

  • (:meters, :miles, :centimeters, :millimeters, :kilometers, :nauticalmiles, :feet, :yards, :inch)


1208
1209
1210
# File 'lib/couchbase/search_options.rb', line 1208

def unit
  @unit
end