Skip to content
This repository has been archived by the owner on Sep 8, 2022. It is now read-only.

Commit

Permalink
working with ruby 1.8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
esdras committed Apr 10, 2011
1 parent 8d4ebea commit b10bac5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 0 additions & 1 deletion README
Expand Up @@ -40,4 +40,3 @@ geo.completeness # => 88


The returned attributes are: lat, lng, city, state, provider, zip, street, district, number

10 changes: 9 additions & 1 deletion lib/simple_geolocation/geocoder.rb
Expand Up @@ -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
Expand Down Expand Up @@ -35,5 +39,9 @@ def success!
@success = true
end

def attributes
@attributes ||= Hash[self.class.keys.map { |k| [k, send(k)] }]
end

end
end
2 changes: 1 addition & 1 deletion lib/simple_geolocation/version.rb
@@ -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.