Skip to content
Snippets Groups Projects
Commit 06681c9b authored by Alex Reisner's avatar Alex Reisner
Browse files

Fix/clarify comments.

parent 9e818710
No related branches found
No related tags found
No related merge requests found
...@@ -10,9 +10,9 @@ module Geocoder ...@@ -10,9 +10,9 @@ module Geocoder
end end
## ##
# Calculate the distance from the object to a point (lat,lon). # Calculate the distance from the object to an arbitrary point.
# # Takes two floats (latitude, longitude) and a symbol specifying the
# <tt>:units</tt> :: <tt>:mi</tt> (default) or <tt>:km</tt> # units to be used (:mi or :km; default is :mi).
# #
def distance_to(lat, lon, units = :mi) def distance_to(lat, lon, units = :mi)
return nil unless geocoded? return nil unless geocoded?
...@@ -23,9 +23,8 @@ module Geocoder ...@@ -23,9 +23,8 @@ module Geocoder
alias_method :distance_from, :distance_to alias_method :distance_from, :distance_to
## ##
# Get other geocoded objects within a given radius. # Get nearby geocoded objects. Takes a radius (integer) and a symbol
# # representing the units of the ratius (:mi or :km; default is :mi).
# <tt>:units</tt> :: <tt>:mi</tt> (default) or <tt>:km</tt>
# #
def nearbys(radius = 20, units = :mi) def nearbys(radius = 20, units = :mi)
return [] unless geocoded? return [] unless geocoded?
...@@ -34,8 +33,11 @@ module Geocoder ...@@ -34,8 +33,11 @@ module Geocoder
end end
## ##
# Look up geographic data based on object attributes, # Look up geographic data based on object attributes (configured in
# and do something with it (requires a block). # geocoded_by or reverse_geocoded_by) and handle the result with the
# block (given to geocoded_by or reverse_geocoded_by). The block is
# given two-arguments: the object being geocoded and a
# Geocoder::Result object with the geocoding results).
# #
def geocode def geocode
options = self.class.geocoder_options options = self.class.geocoder_options
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment