muve-store-mongo 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/muve-store-mongo/formatter.rb +23 -1
- data/lib/muve-store-mongo/version.rb +1 -1
- data/spec/mongo_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a54cea969848deae36905fe9c1f2d3a5c8581638
|
4
|
+
data.tar.gz: 45071d4dbdf35c54e05daab68a05141f2b971527
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b13dd094274adc9c08380b39091e00a4ee7cce1eafa02a382b0283072d52ad4a3719c2ac67d7d72009c55d011da7111ce2e595ef76ba3c801a01991ad13dc79
|
7
|
+
data.tar.gz: 15740a9853c2cb63c2aabb6bd81eceac2d5af491b9ef64e1c2fe912f9dc3e0726550470af490a4fb665a95f1efb4738714f3edb29efb41590a0bf4032f300fb3
|
data/Gemfile
CHANGED
@@ -9,10 +9,32 @@ module Muve
|
|
9
9
|
type: 'Place',
|
10
10
|
coordinates: [resource.longitude, resource.latitude]
|
11
11
|
} if resource.kind_of? Muve::Location
|
12
|
+
return resource.name if resource.kind_of? Muve::Traveller
|
12
13
|
resource
|
13
14
|
end
|
14
15
|
|
15
|
-
def self.convert_from_storeable_object(storeable)
|
16
|
+
def self.convert_from_storeable_object(storeable, klass=nil)
|
17
|
+
if klass
|
18
|
+
return {
|
19
|
+
id: storeable[:id],
|
20
|
+
name: storeable[:name],
|
21
|
+
location: (Location.new({
|
22
|
+
latitude: storeable[:location]["coordinates"][1],
|
23
|
+
longitude: storeable[:location]["coordinates"][0]
|
24
|
+
}) if storeable[:location] && storeable[:location]["coordinates"])
|
25
|
+
} if (klass < Muve::Place)
|
26
|
+
|
27
|
+
return {
|
28
|
+
id: storeable[:id],
|
29
|
+
time: storeable[:time],
|
30
|
+
traveller: Traveller.new(name: storeable[:traveller]),
|
31
|
+
location: Location.new(
|
32
|
+
latitude: storeable[:location]["coordinates"][1],
|
33
|
+
longitude: storeable[:location]["coordinates"][0]
|
34
|
+
)
|
35
|
+
} if (klass < Muve::Movement)
|
36
|
+
end
|
37
|
+
|
16
38
|
if storeable.kind_of? Hash
|
17
39
|
if Helper.symbolize_keys(storeable).to_a.include? [:type, 'Place']
|
18
40
|
Location.new(latitude: storeable[:coordinates][1], longitude: storeable[:coordinates][0]) if storeable[:coordinates]
|
data/spec/mongo_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muve-store-mongo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Asabina
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: muve
|