easymongo 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/easymongo.gemspec +2 -2
- data/lib/easymongo/document.rb +12 -1
- data/lib/easymongo.rb +0 -1
- 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: a74df8d35081f9de37e9587ef1256c67683fc0c7
|
4
|
+
data.tar.gz: 36a35bf556d02bd4378a8ba5f64d42ef24c39eed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae68168f09e312070def9f09022002790770a09f635c3700a3406296e17b392d9e9b329b5280b1c3ffcf6eb9daeec2a84bb60847e3cf67b680a67e280765cef0
|
7
|
+
data.tar.gz: '084053b5a8af6a604afee5d41d221f786220695a901ec0a7d3afad37e09f24ac3986db76f3a6e779026d6cfe81660fe09c53a323802ab81e18edb91155775b1e'
|
data/easymongo.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'easymongo'
|
3
|
-
s.version = '0.0.
|
4
|
-
s.date = '2017-07-
|
3
|
+
s.version = '0.0.6'
|
4
|
+
s.date = '2017-07-20'
|
5
5
|
s.summary = "Super Easy MongoDB client"
|
6
6
|
s.description = "The way MongoDB for Ruby should be, can't get easier than this"
|
7
7
|
s.authors = ["Fugroup Limited"]
|
data/lib/easymongo/document.rb
CHANGED
@@ -13,7 +13,18 @@ module Easymongo
|
|
13
13
|
doc.each{|k, v| doc[k] = v.to_s if v.is_a?(BSON::ObjectId)}
|
14
14
|
|
15
15
|
# Write variables
|
16
|
-
doc.each{|k, v| attr(k, v)}
|
16
|
+
# doc.each{|k, v| attr(k, v)}
|
17
|
+
self.attributes = doc
|
18
|
+
end
|
19
|
+
|
20
|
+
# Get attributes as hash
|
21
|
+
def attributes
|
22
|
+
Hash[instance_variables.map{|r| [r[1..-1].to_sym, instance_variable_get(r)]}]
|
23
|
+
end
|
24
|
+
|
25
|
+
# Set attributes
|
26
|
+
def attributes=(data)
|
27
|
+
data.each{|k, v| attr(k, v)}
|
17
28
|
end
|
18
29
|
|
19
30
|
# Get bson id
|
data/lib/easymongo.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easymongo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fugroup Limited
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongo
|