Module: Mongoid::Geo

Defined in:
lib/mongoid/geo.rb,
lib/mongoid/geo/unit.rb,
lib/mongoid/geo/point.rb,
lib/mongoid/geo/point.rb,
lib/mongoid/geo/geo_near.rb,
lib/mongoid/geo/haversine.rb

Defined Under Namespace

Modules: Model, Models, Near, Point, PointConversion Classes: Haversine, Unit

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.mongo_db_versionObject

Returns the value of attribute mongo_db_version.



9
10
11
# File 'lib/mongoid/geo/geo_near.rb', line 9

def mongo_db_version
  @mongo_db_version
end

.sphericalObject

Returns the value of attribute spherical.



10
11
12
# File 'lib/mongoid/geo/geo_near.rb', line 10

def spherical
  @spherical
end

Class Method Details

.lat_indexObject



19
20
21
# File 'lib/mongoid/geo/geo_near.rb', line 19

def lat_index
  @spherical ? 1 : 0
end

.lng_indexObject



23
24
25
# File 'lib/mongoid/geo/geo_near.rb', line 23

def lng_index
  @spherical ? 0 : 1
end

.spherical_mode(mode = true, &block) ⇒ Object



12
13
14
15
16
17
# File 'lib/mongoid/geo/geo_near.rb', line 12

def spherical_mode mode = true, &block
  @spherical, old_spherical, result = mode, @spherical, @spherical
  result = yield if block
  @spherical = old_spherical
  result
end