easymongo 0.0.5 → 0.0.6

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: cba05d54e026c7b45fb75333246960f67e9b69b8
4
- data.tar.gz: 15dc3132d2094ca2d100906aebcdc6e40fab3cfe
3
+ metadata.gz: a74df8d35081f9de37e9587ef1256c67683fc0c7
4
+ data.tar.gz: 36a35bf556d02bd4378a8ba5f64d42ef24c39eed
5
5
  SHA512:
6
- metadata.gz: 898a6fdd306de4580a85eb94a988f3d9461a4745bf365df63339a61f91a9f1fec17c2f6456b1a25f067d88ce6d0393d2e67cf26a4b9d8bc35470dec35fba2979
7
- data.tar.gz: e95bbe7722137580f8b179ae0a4902919bbe43d29de27aa01d308ef4e8fc6942cc7006b7ca51e1efd7cf51529c9250096cd60384b861bf6029b5b9bb07b84c84
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.5'
4
- s.date = '2017-07-13'
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"]
@@ -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
@@ -7,7 +7,6 @@ module Easymongo
7
7
  # @author: Vidar <vidar@fugroup.net>, Fugroup Ltd.
8
8
  # @license: MIT, contributions are welcome.
9
9
 
10
- class << self; attr_accessor :schema; end
11
10
  end
12
11
 
13
12
  require_relative 'easymongo/document'
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.5
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-13 00:00:00.000000000 Z
11
+ date: 2017-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongo