From bf657d01323d7d52a61c1a0b644cd9c1b2decf17 Mon Sep 17 00:00:00 2001
From: Alex Reisner <alex@alexreisner.com>
Date: Sat, 22 Dec 2012 19:21:14 -0500
Subject: [PATCH] Add Geocoder::Query#url method.

---
 lib/geocoder/cli.rb   | 2 +-
 lib/geocoder/query.rb | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/geocoder/cli.rb b/lib/geocoder/cli.rb
index 74e5bb1f..536aec09 100644
--- a/lib/geocoder/cli.rb
+++ b/lib/geocoder/cli.rb
@@ -79,7 +79,7 @@ module Geocoder
 
       if show_url
         q = Geocoder::Query.new(query)
-        out << q.lookup.query_url(q) + "\n"
+        out << q.url + "\n"
         exit 0
       end
 
diff --git a/lib/geocoder/query.rb b/lib/geocoder/query.rb
index d0f4469e..c17ba159 100644
--- a/lib/geocoder/query.rb
+++ b/lib/geocoder/query.rb
@@ -36,6 +36,10 @@ module Geocoder
       Lookup.get(name)
     end
 
+    def url
+      lookup.query_url(self)
+    end
+
     ##
     # Is the Query blank? (ie, should we not bother searching?)
     # A query is considered blank if its text is nil or empty string AND
-- 
GitLab