ssdb-attr 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: b2b52304c9d46396222d910c03ab4a3eb12d0210
4
- data.tar.gz: 036af4b696a6ab5b733c71d01de9447303000ba7
3
+ metadata.gz: c2a68a5814ca537bb67770f14fb335ecb2fd8ab9
4
+ data.tar.gz: e42026f5032a122f2546d1c3da070203d9e12b97
5
5
  SHA512:
6
- metadata.gz: bcee95b48f327fac5b65c582c89539c2c45a11e88b136e8084a229d5ed898e93bf4d1c0f472b05a68827acffb9ae25fd4a33f3ff04a4fcaf2972efb83305e2df
7
- data.tar.gz: f66d638aead72c1de92caf614bb03d8d07c6358f59967fa9bb1c3b1835982fa26fd04c24d2922422506b15a900c46c3defcfc964983416aaa4b15f28371ee3c7
6
+ metadata.gz: 43fe05c73f91bd48dbdaf0c16113268561cee70e00e59460ed47d78626bc71637fb5978bbfbad5f0695f9ddf109c6b42d24fa5acebdf1759d30f6cde90cd47c6
7
+ data.tar.gz: 5470f3d596b29718a97dc3c83b4924ec9a5c238498943be5e8807aafae21f810643f984685e90a4201ec7f1438dfb6efe634c58114a09f7dda1f7b82f96cec1a
data/README.md CHANGED
@@ -1 +1,3 @@
1
- # ssdb-attr
1
+ # SSDB Attr
2
+
3
+ This gem provides an intuitive interface to define attributes on your ActiveModel class and save them in SSDB server.
data/lib/ssdb-attr.rb CHANGED
@@ -23,6 +23,13 @@ module SSDBAttr
23
23
  # `pool`: Pool size of the connection pool. Default to 1.
24
24
  # `timeout`: Timeout of the connection pool, in second, Default to 2.
25
25
  #
26
+ # Examples:
27
+ #
28
+ # `SSDBAttr.setup({ :url => "redis://localhost:8888" })`: will setup a single pool to the SSDB instance `url` points to.
29
+ # `SSDBAttr.setup({ :url => "redis://localhost:8888", :name => :main })`: will setup a named single pool.
30
+ # `SSDBAttr.setup([ { :url => "redis://localhost:8888", :name => :pool1 }, { :url => "redis://localhost:6379", :name => :pool2 } ])`: will setup two named pools.
31
+ #
32
+ #
26
33
  # @param [Hash] options
27
34
  #
28
35
  # @return [void]
@@ -1,3 +1,3 @@
1
1
  module SSDBAttr
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/ssdb/attr.rb CHANGED
@@ -26,6 +26,13 @@ module SSDB
26
26
  @ssdb_attr_id_field = field_name
27
27
  end
28
28
 
29
+ #
30
+ # Specify which SSDB ConnectionPool current class should use, by name specified in `SSDBAttr.setup`
31
+ #
32
+ # @param [String/Symbol] pool_name
33
+ #
34
+ # @return [String/Symbol]
35
+ #
29
36
  def ssdb_attr_pool(pool_name)
30
37
  @ssdb_attr_pool_name = pool_name
31
38
  end
@@ -86,6 +93,12 @@ module SSDB
86
93
 
87
94
  private
88
95
 
96
+ #
97
+ # Return the ConnectionPool used by current Class.
98
+ #
99
+ #
100
+ # @return [ConnectionPool]
101
+ #
89
102
  def ssdb_attr_pool
90
103
  SSDBAttr.pool(self.class.ssdb_attr_pool_name)
91
104
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssdb-attr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Larry Zhao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-03 00:00:00.000000000 Z
11
+ date: 2017-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  version: '0'
193
193
  requirements: []
194
194
  rubyforge_project:
195
- rubygems_version: 2.6.7
195
+ rubygems_version: 2.5.1
196
196
  signing_key:
197
197
  specification_version: 4
198
198
  summary: Provide simple helpers on persist values in redis for performance. Works