Module: Mongoid::Spacial::Document

Extended by:
ActiveSupport::Concern
Defined in:
lib/mongoid_spacial/spacial/document.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#distance_from(key, p2, opts = {}) ⇒ Object



23
24
25
26
# File 'lib/mongoid_spacial/spacial/document.rb', line 23

def distance_from(key,p2, opts = {})
  p1 = self.send(key)
  Mongoid::Spacial.distance(p1, p2, opts)
end