redis-hash 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/{redis/hash.rb → redis_hash.rb} +5 -5
- data/redis-hash.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dd513ffa6a5374f208a77c5691d904159cd2b30
|
4
|
+
data.tar.gz: 1fd22758f74c901188e26d6c39609d7439cf74f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb7f0371d442f9a920fe35dfdf5a09143834985b1a835301b9040b190595990abd061cdfa212590fdb6a0402e743e7fc8221c972dc3cbbf3ab1c2d8221f5513e
|
7
|
+
data.tar.gz: fc40ad9e406554dc072f0e8f7c648b870cfa59bf5a83d5fa30bf441c9831fb7b7cfe24ac6eb52ba1fecfb76ed07c2f40e73625ec42494056d3ed55bde3a823f2
|
@@ -3,7 +3,7 @@ require "redis"
|
|
3
3
|
class RedisHash
|
4
4
|
attr_reader :name
|
5
5
|
|
6
|
-
VERSION = "0.0.
|
6
|
+
VERSION = "0.0.2"
|
7
7
|
|
8
8
|
class InvalidNameException < StandardError; end;
|
9
9
|
class InvalidRedisConfigException < StandardError; end;
|
@@ -47,15 +47,15 @@ class RedisHash
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
def set_if_does_not_exist
|
51
|
-
@redis.hsetnx(name,
|
50
|
+
def set_if_does_not_exist hash
|
51
|
+
@redis.hsetnx(name, hash.keys.first, hash.values.first)
|
52
52
|
end
|
53
53
|
|
54
|
-
def increment_integer_key key, increment_amount
|
54
|
+
def increment_integer_key key, increment_amount = 1
|
55
55
|
@redis.hincrby(name, key, increment_amount)
|
56
56
|
end
|
57
57
|
|
58
|
-
def increment_float_key key, increment_amount
|
58
|
+
def increment_float_key key, increment_amount = 1
|
59
59
|
@redis.hincrbyfloat(name, key, increment_amount)
|
60
60
|
end
|
61
61
|
|
data/redis-hash.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis-hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Misha Conway
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -81,7 +81,7 @@ files:
|
|
81
81
|
- Rakefile
|
82
82
|
- bin/console
|
83
83
|
- bin/setup
|
84
|
-
- lib/
|
84
|
+
- lib/redis_hash.rb
|
85
85
|
- redis-hash.gemspec
|
86
86
|
homepage: https://github.com/MishaConway/ruby-redis-hash
|
87
87
|
licenses:
|