From 200afe463003808f021d1bc1233093f38d1d252d Mon Sep 17 00:00:00 2001
From: Alex Reisner <alex@alexreisner.com>
Date: Wed, 15 Sep 2010 00:33:01 -0400
Subject: [PATCH] Code cleanup: move method down several lines.

---
 lib/geocoder.rb | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/lib/geocoder.rb b/lib/geocoder.rb
index bce5e653..46c810f0 100644
--- a/lib/geocoder.rb
+++ b/lib/geocoder.rb
@@ -227,25 +227,6 @@ module Geocoder
     fetch_coordinates(true)
   end
 
-  ##
-  # Query Google for the coordinates of the given phrase.
-  # Returns array [lat,lon] if found, nil if not found or if network error.
-  #
-  def self.fetch_coordinates(query)
-    return nil if query.blank?
-    return nil unless doc = self.search(query)
-    
-    # make sure search found a result
-    e = doc.elements['GeocodeResponse/status']
-    return nil unless (e and e.text == "OK")
-
-    # isolate the relevant part of the result
-    place = doc.elements['GeocodeResponse/result/geometry/location']
-
-    # blindly use the first results (assume they are most accurate)
-    ['lat', 'lng'].map{ |i| place.elements[i].text.to_f }
-  end
-  
   ##
   # Calculate the distance between two points on Earth (Haversine formula).
   # Takes two sets of coordinates and an options hash:
@@ -337,6 +318,25 @@ module Geocoder
     end
   end
   
+  ##
+  # Query Google for the coordinates of the given phrase.
+  # Returns array [lat,lon] if found, nil if not found or if network error.
+  #
+  def self.fetch_coordinates(query)
+    return nil if query.blank?
+    return nil unless doc = self.search(query)
+    
+    # make sure search found a result
+    e = doc.elements['GeocodeResponse/status']
+    return nil unless (e and e.text == "OK")
+
+    # isolate the relevant part of the result
+    place = doc.elements['GeocodeResponse/result/geometry/location']
+
+    # blindly use the first results (assume they are most accurate)
+    ['lat', 'lng'].map{ |i| place.elements[i].text.to_f }
+  end
+  
   ##
   # Request an XML geo search result from Google.
   # This method is not intended for general use (prefer Geocoder.search).
-- 
GitLab