redis_rds 0.1.2 → 0.1.3
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 +4 -4
- data/lib/redis_rds/string.rb +13 -2
- data/lib/redis_rds/version.rb +1 -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: a243eb323248a618bbe87782c40fa7f537dcb5b1
|
4
|
+
data.tar.gz: 81dfe8a47c0b3a64dc4e73589bdb4e70cd1aaabe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3659805494943fbd42f2ea773baa4003d1716f187871a49740518187de05c9a671826cf0cd9dea0ec2416d4b400514a1ac336a725b6ea85bfdc5e01a802811c8
|
7
|
+
data.tar.gz: 7dc6453f5f23bbe5955e8978b3e4acfe0ba79caf6dab861ecaf7fac971d2cce416c805ad1b5e7d91404fbd1fbaa0b88a68c5c04671812f71659e809aed4a0775
|
data/lib/redis_rds/string.rb
CHANGED
@@ -4,8 +4,19 @@ module RedisRds
|
|
4
4
|
return connection.get(@redis_key)
|
5
5
|
end
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
# Lifted from npepine/restruct
|
8
|
+
# @param [Object] value The object to store; note, it will be stored using a string representation
|
9
|
+
# @param [Integer] expiry The expiry time in seconds; if nil, will never expire
|
10
|
+
# @param [Boolean] nx Not Exists: if true, will not set the key if it already existed
|
11
|
+
# @param [Boolean] xx Already Exists: if true, will set the key only if it already existed
|
12
|
+
# @return [Boolean] True if set, false otherwise
|
13
|
+
def set(value, expiry: nil, nx: nil, xx: nil)
|
14
|
+
options = {}
|
15
|
+
options[:ex] = expiry.to_i unless expiry.nil?
|
16
|
+
options[:nx] = nx unless nx.nil?
|
17
|
+
options[:xx] = xx unless xx.nil?
|
18
|
+
|
19
|
+
connection.set(@redis_key, value, options)
|
9
20
|
end
|
10
21
|
|
11
22
|
def setex(value, expiry)
|
data/lib/redis_rds/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis_rds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Checkitmobile GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|