mongous 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ffb544bfae82a4597345d166e314e50eb6e251f44f57c5da4dfc9fab6680970
4
- data.tar.gz: 909fcdcc00bb4ea65bf691b79420a9c6bed4fee4e07cfe0dee8c8da2bbd344a4
3
+ metadata.gz: 4f126c03248f80e7dd9c674ddff08879a994ecf36d8c443d0bb43694f6a6fd53
4
+ data.tar.gz: d9c694cfd344075ec4d744a71562281ba61dac5c3df011154df0b65cd443041e
5
5
  SHA512:
6
- metadata.gz: 21bacfb05dbf0d0c2193759e50df55ff4ae7432522fea90ee30688f6ccc6e9a42b9645dac9f41f3a0b0ce1114c63cbdc9a18ae633b8db84639a1b8cc8ea7a49a
7
- data.tar.gz: 2eef0a2fecffd43f12cbe65cea598795835727248af48c9fc45385f23a0f23ec7dda910daea6bc66b9bd2906e443f95ceefd3f644046e2cd4b36793347d2b067
6
+ metadata.gz: 867d5753bac0b0a1bea9b82b4a650fcda7233465cc9e03529488e533464ec86a0d9e387afa220bdc019de07522af96e53e644fbbd92d9e5e465c69af47b9b15e
7
+ data.tar.gz: e0cf057b86df920b3e2f47c26c6fedb8bcbf2ccdb5232cebb3ba3b0fd02ee7b71c90274e0ac3a168d01c5d4cd396131ba5872e286c039b91103924e1bb752689
@@ -163,7 +163,7 @@ Mongous.connect( hosts_or_uri = nil, **opts )
163
163
  ----
164
164
 
165
165
  * Result:
166
- ** Mongous::Client.
166
+ ** Mongo::Client.
167
167
 
168
168
  === Include document functions.
169
169
 
@@ -163,7 +163,7 @@ Mongous.connect( hosts_or_uri = nil, **opts )
163
163
  ----
164
164
 
165
165
  * Result:
166
- ** Mongous::Client.
166
+ ** Mongo::Client.
167
167
 
168
168
  === ドキュメントの機能を取り入れる.
169
169
 
@@ -7,9 +7,9 @@ module Mongous
7
7
  end
8
8
  end
9
9
 
10
- def initialize( **doc )
10
+ def initialize( doc = nil, **hash )
11
11
  @doc = {}
12
- doc.each do |label, value|
12
+ (doc || hash).each do |label, value|
13
13
  label = label.to_s
14
14
  @doc[label] = value
15
15
  end
@@ -91,8 +91,8 @@ module Mongous
91
91
  end
92
92
  end
93
93
 
94
- def create( **doc )
95
- self.new( **doc ).save
94
+ def create( doc = nil, **hash )
95
+ self.new( doc || hash ).save
96
96
  end
97
97
 
98
98
  def filter( **_filter )
@@ -102,12 +102,12 @@ module Mongous
102
102
 
103
103
  def first
104
104
  doc = do_find.first
105
- @klass.new( **doc ) if doc
105
+ @klass.new( doc ) if doc
106
106
  end
107
107
 
108
108
  def all
109
109
  do_find.map do |doc|
110
- @klass.new( **doc )
110
+ @klass.new( doc )
111
111
  end
112
112
  end
113
113
 
@@ -1,3 +1,3 @@
1
1
  module Mongous
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
 
9
9
  spec.summary = %q{ Mongo wrapper library. }
10
10
  spec.description = %q{ Yet another lightweight mongo wrapper library. }
11
- spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
11
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
12
12
 
13
13
  # Specify which files should be added to the gem when it is released.
14
14
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -8,6 +8,11 @@ class Book
8
8
  end
9
9
 
10
10
 
11
- book = Book.new( title: "title basic 1", author: "Alice", style: "A4", price: 1000, page: 100 )
11
+ book = Book.new
12
+ book.title = "title basic 2"
13
+ book.author = "Bob"
14
+ book.style = "A5"
15
+ book.price = 2000
16
+ book.page = 200
12
17
  book.save
13
18
 
@@ -8,11 +8,6 @@ class Book
8
8
  end
9
9
 
10
10
 
11
- book = Book.new
12
- book.title = "title basic 2"
13
- book.author = "Bob"
14
- book.style = "A5"
15
- book.price = 2000
16
- book.page = 200
11
+ book = Book.new( title: "title basic 1", author: "Alice", style: "A4", price: 1000, page: 100 )
17
12
  book.save
18
13
 
@@ -9,5 +9,5 @@ end
9
9
 
10
10
 
11
11
  doc = { title: "title basic 3", author: "Candy", style: "A6", price: 3000, page: 300 }
12
- Book.create( **doc )
12
+ Book.create( doc )
13
13
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongous
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ARIMA Yasuhiro
@@ -132,7 +132,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
132
  requirements:
133
133
  - - ">="
134
134
  - !ruby/object:Gem::Version
135
- version: 2.7.0
135
+ version: 2.6.0
136
136
  required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  requirements:
138
138
  - - ">="