Permalink
Browse files

working with ruby 1.8.7

  • Loading branch information...
1 parent 8d4ebea commit b10bac5c0fe71ba59bc827571fbdcb23305aeb20 @esdras committed Apr 10, 2011
Showing with 10 additions and 3 deletions.
  1. +0 −1 README
  2. +9 −1 lib/simple_geolocation/geocoder.rb
  3. +1 −1 lib/simple_geolocation/version.rb
View
1 README
@@ -40,4 +40,3 @@ geo.completeness # => 88
The returned attributes are: lat, lng, city, state, provider, zip, street, district, number
-
@@ -4,7 +4,11 @@ class Geocoder
attr_reader :success, :raw_location, :location
alias :success? :success
- delegate *(Location::ATTRIBUTES + [:completeness]), :to => :location
+ def self.keys
+ Location::ATTRIBUTES + [:completeness]
+ end
+
+ delegate :lat, :lng, :city, :state, :provider, :zip, :street, :district, :number, :completeness, :to => :location
def initialize(raw_location)
@raw_location = raw_location
@@ -35,5 +39,9 @@ def success!
@success = true
end
+ def attributes
+ @attributes ||= Hash[self.class.keys.map { |k| [k, send(k)] }]
+ end
+
end
end
@@ -1,3 +1,3 @@
module SimpleGeolocation
- VERSION = "0.0.2"
+ VERSION = "0.0.5"
end

0 comments on commit b10bac5

Please sign in to comment.