simple_geolocation 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README CHANGED
@@ -40,4 +40,3 @@ geo.completeness # => 88
40
40
 
41
41
 
42
42
  The returned attributes are: lat, lng, city, state, provider, zip, street, district, number
43
-
@@ -4,7 +4,11 @@ module SimpleGeolocation
4
4
  attr_reader :success, :raw_location, :location
5
5
  alias :success? :success
6
6
 
7
- delegate *(Location::ATTRIBUTES + [:completeness]), :to => :location
7
+ def self.keys
8
+ Location::ATTRIBUTES + [:completeness]
9
+ end
10
+
11
+ delegate *keys, :to => :location
8
12
 
9
13
  def initialize(raw_location)
10
14
  @raw_location = raw_location
@@ -35,5 +39,9 @@ module SimpleGeolocation
35
39
  @success = true
36
40
  end
37
41
 
42
+ def attributes
43
+ @attributes ||= Hash[self.class.keys.map { |k| [k, send(k)] }]
44
+ end
45
+
38
46
  end
39
47
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleGeolocation
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: simple_geolocation
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Esdras Mayrink
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-04 00:00:00 -03:00
13
+ date: 2011-04-10 00:00:00 -03:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency