dynamodb_geo 0.1.8 → 0.2.0
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/store.rb +9 -0
- 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: 5585912cbe804676b364ed0479bdd68aad683550502a17517124c567e611b2b8
|
4
|
+
data.tar.gz: 95177885630267acddf06e386888331d0951577203837a82e03303a6a9873959
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76b27bb7675df86c7bcbaab037cd925ae0b38d5d7b02634dd596776d039c7af22377c3cc2f868afa07d6e86260b632ea112c404efbffffcb9c815c10ff263002
|
7
|
+
data.tar.gz: 4bb8c017c50005483deabac163d9df33bfbb3ac6b43522444fc9cc8c9ef24a4ec675d072282fe8635787c4e48731c57396335a0350217b125530e93d173e6471
|
data/lib/dynamodb_geo/version.rb
CHANGED
data/lib/store.rb
CHANGED
@@ -13,4 +13,13 @@ class Store
|
|
13
13
|
@geohash = store_data[:geohash] || Geohash.encode(lat, long, 10)
|
14
14
|
@uuid = store_data[:uuid]
|
15
15
|
end
|
16
|
+
|
17
|
+
def to_h
|
18
|
+
temp = instance_variables.map do |v|
|
19
|
+
value = self.send(v.to_s.sub('@',''))
|
20
|
+
value = value.class == BigDecimal ? value.to_f : value
|
21
|
+
Hash[v.to_s.sub('@','').to_sym, value]
|
22
|
+
end
|
23
|
+
Hash[*temp.collect{|h| h.to_a}.flatten]
|
24
|
+
end
|
16
25
|
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.
|
4
|
+
version: 0.2.0
|
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.
|
130
|
+
summary: dynamodb_geo-0.2.0
|
131
131
|
test_files:
|
132
132
|
- spec/dynamodb_geo_spec.rb
|
133
133
|
- spec/geohash_spec.rb
|