dynamodb_geo 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dynamodb_geo/version.rb +1 -1
- data/lib/dynamodb_manager.rb +3 -3
- data/lib/store.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbbaf8b8e654469fa6eb8bae4a2f5b82822cef9469cf6748e937946ca885aa26
|
4
|
+
data.tar.gz: 56a1e5719a58a56e7bb4aaad5d4a18eb58103c3aac4bd0ba19d3acb1844a61fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43b1bdb8a511f633f08a7cfd7dd2aebcc9f5910e6a3dff65bd354d8241f5d524ce7a0b959e7f66a894ee05259527434f37d0529fc3a9b5bc6fe0802c3fd07f3d
|
7
|
+
data.tar.gz: 7ce0e309eb35766a074bd5a702eb22156a0685a965a219a52045fd4e8c1f5a6f9244eb1394bbab72e7ab2d7fc28d7b3f9367c34f6e957b6b54946de7196dea85
|
data/lib/dynamodb_geo/version.rb
CHANGED
data/lib/dynamodb_manager.rb
CHANGED
@@ -56,7 +56,7 @@ class DynamodbManager
|
|
56
56
|
phone: store.phone,
|
57
57
|
name: store.name,
|
58
58
|
}
|
59
|
-
put_point(hash, json)
|
59
|
+
put_point(hash, json, store.uuid)
|
60
60
|
end
|
61
61
|
|
62
62
|
def get_stores(lat, long)
|
@@ -118,8 +118,8 @@ class DynamodbManager
|
|
118
118
|
})
|
119
119
|
end
|
120
120
|
|
121
|
-
def put_point(hash, json)
|
122
|
-
uuid
|
121
|
+
def put_point(hash, json, uuid = nil)
|
122
|
+
uuid ||= SecureRandom.uuid
|
123
123
|
|
124
124
|
@client.put_item({
|
125
125
|
table_name: @table_name,
|
data/lib/store.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Store
|
2
|
-
attr_accessor :lat, :long, :address, :city, :state, :zip, :area_code, :phone, :name, :geohash
|
2
|
+
attr_accessor :lat, :long, :address, :city, :state, :zip, :area_code, :phone, :name, :geohash, :uuid
|
3
3
|
def initialize(store_data)
|
4
4
|
@lat = store_data[:latitude]
|
5
5
|
@long = store_data[:longitude]
|
@@ -11,5 +11,6 @@ class Store
|
|
11
11
|
@phone = store_data[:phone]
|
12
12
|
@name = store_data[:name]
|
13
13
|
@geohash = store_data[:geohash] || Geohash.encode(lat, long, 10)
|
14
|
+
@uuid = store_data[:uuid]
|
14
15
|
end
|
15
16
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamodb_geo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Ahn
|
@@ -127,7 +127,7 @@ requirements: []
|
|
127
127
|
rubygems_version: 3.1.2
|
128
128
|
signing_key:
|
129
129
|
specification_version: 4
|
130
|
-
summary: dynamodb_geo-0.1.
|
130
|
+
summary: dynamodb_geo-0.1.6
|
131
131
|
test_files:
|
132
132
|
- spec/dynamodb_geo_spec.rb
|
133
133
|
- spec/geohash_spec.rb
|