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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aed98af107edcc4945a66ad7cfedc3b068ce1ee4
4
- data.tar.gz: afaaeb9760728471e5fb052f87ba31c8d9a62049
3
+ metadata.gz: 8dd513ffa6a5374f208a77c5691d904159cd2b30
4
+ data.tar.gz: 1fd22758f74c901188e26d6c39609d7439cf74f0
5
5
  SHA512:
6
- metadata.gz: dcf3f11332840f8a78887831f4861e3fe49afc259090c4a0e9982477eb46087f4b24d329958bf69cb30595c85a7fbd616031f56028723255081d2a49959b0c9f
7
- data.tar.gz: 852e42e4efb1c20fcb46f43923e6afaf5834fa591443499a95e6107016cf4dbe02908a4eba277b2e87b438c265775f77497019121ba0ec8e8058762c3208686a
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.1"
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 key, value
51
- @redis.hsetnx(name, key, value)
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
@@ -1,7 +1,7 @@
1
1
 
2
2
  lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "redis/hash"
4
+ require "redis_hash"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "redis-hash"
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.1
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-21 00:00:00.000000000 Z
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/redis/hash.rb
84
+ - lib/redis_hash.rb
85
85
  - redis-hash.gemspec
86
86
  homepage: https://github.com/MishaConway/ruby-redis-hash
87
87
  licenses: