enrichment_db 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f741a0f881ad8ee9b09cd3a4efc4c92b98fcbeeb
4
- data.tar.gz: 06ec8db95c457f3a0b763c4b672d7a16cc8d9f19
3
+ metadata.gz: f7d5e4be11883e9a386d517823cebcd8ad3b9dd1
4
+ data.tar.gz: 36b504175bb868cd2d862456b0a2a629d5a6c699
5
5
  SHA512:
6
- metadata.gz: ee73180341e7549eaa97191a8eaaf5250498cec035de6b258845c5c137f6f23814ddd954158b78fa50a360a0e3296c79328ba1e490ae8c2966cb069d1e28eaff
7
- data.tar.gz: 796c37fdd9cae746ad9d662448c880a204ec3e4ed4f633a9f95a5f192097fbf717eede39d2fa2e033a4a21275fa0f1ef23a90d56d65dbd90cb44c9a9601db26c
6
+ metadata.gz: bf9cd7afad40e5a7aeef2128a1ef7275c744a9b07cb7d680bf4ba7f02f0b1dfce100d4be6c4dfe57885c421477263860c892725711fb02e5d9800172050bb29d
7
+ data.tar.gz: b6e97338ce58983511861c931efe7ca72479256e014d9486a847756796ec8d9f33488946bfb7bf57eb9c8724f949466b542558cedab1558e857afc96eaa3135e
@@ -3,5 +3,5 @@ module EnrichmentDb
3
3
 
4
4
  RequestError = Class.new(Error)
5
5
  InvalidObject = Class.new(Error)
6
- InvalidFormat = Class.new(Error)
6
+ InvalidGeoPointFormat = Class.new(Error)
7
7
  end
@@ -80,14 +80,14 @@ class EnrichmentDb::Geo::Locator < EnrichmentDb::DatumModel
80
80
  def self.format_geo(geo)
81
81
  return geo if geo.is_a?(String)
82
82
 
83
- fail EnrichmentDb::InvalidFormat unless valid_geo_point?(geo)
83
+ fail EnrichmentDb::InvalidGeoPointFormat unless valid_geo_point?(geo)
84
84
  geo[:lat] ||= geo['lat']
85
- geo[:long] ||= geo['long']
86
- GeoHash.encode(geo[:lat], geo[:long])
85
+ geo[:lon] ||= geo['lon']
86
+ GeoHash.encode(geo[:lat], geo[:lon])
87
87
  end
88
88
 
89
89
  def self.valid_geo_point?(geo_point)
90
- geo_point.is_a?(Hash) && geo_point.keys.sort.collect(&:to_sym) == [:lat, :long]
90
+ geo_point.is_a?(Hash) && geo_point.keys.sort.collect(&:to_sym) == [:lat, :lon]
91
91
  end
92
92
 
93
93
  private
@@ -1,3 +1,3 @@
1
1
  module EnrichmentDb
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -23,7 +23,7 @@ describe EnrichmentDb::Geo::Locator do
23
23
  lat_long = { 'lat' => lat, 'lon' => long }
24
24
  begin
25
25
  EnrichmentDb::Geo::Locator.format_geo(lat_long)
26
- rescue EnrichmentDb::InvalidFormat => e
26
+ rescue EnrichmentDb::InvalidGeoPointFormat => e
27
27
 
28
28
  else
29
29
  flunk('This should have errored out.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enrichment_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Wallis
@@ -149,4 +149,3 @@ test_files:
149
149
  - test/geo/locator_test.rb
150
150
  - test/reports/TEST-EnrichmentDb-Geo-Locator.xml
151
151
  - test/test_helper.rb
152
- has_rdoc: