From 84ffa52611b167b8da89e23df81bf0273885f791 Mon Sep 17 00:00:00 2001 From: Alex Reisner <alex@alexreisner.com> Date: Fri, 1 Apr 2011 02:30:05 -0400 Subject: [PATCH] Consolidate point argument explanation. --- lib/geocoder/orms/base.rb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/geocoder/orms/base.rb b/lib/geocoder/orms/base.rb index 0ee222d7..2b10be72 100644 --- a/lib/geocoder/orms/base.rb +++ b/lib/geocoder/orms/base.rb @@ -18,8 +18,14 @@ module Geocoder ## # Calculate the distance from the object to an arbitrary point. - # Takes two floats (latitude, longitude) and a symbol specifying the - # units to be used (:mi or :km; default is :mi). + # The point can be: + # + # * an array of coordinates ([lat,lon]) + # * a geocoded object (one which implements a +to_coordinates+ method + # which returns a [lat,lon] array + # * a geocodable address (string) + # + # Also takes a symbol specifying the units (:mi or :km; default is :mi). # def distance_to(point, *args) return nil unless geocoded? @@ -35,12 +41,7 @@ module Geocoder ## # Calculate the bearing from the object to another point. - # The point can be: - # - # * an array of coordinates ([lat,lon]) - # * a geocoded object (one which implements a +to_coordinates+ method - # which returns a [lat,lon] array - # * a geocodable address (string) + # See distance_to for various ways to specify the point. # def bearing_to(point, options = {}) return nil unless them = Geocoder::Calculations.extract_coordinates(point) @@ -51,7 +52,7 @@ module Geocoder ## # Calculate the bearing from another point to the object. - # See bearing_to for details. + # See distance_to for various ways to specify the point. # def bearing_from(point, options = {}) return nil unless them = Geocoder::Calculations.extract_coordinates(point) -- GitLab