redi2casa 0.0.9 → 0.1.0

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: 96b82cd026794edb29fe99d9c7049121975fb146
4
- data.tar.gz: 9ae33d1cf40428135b4db1ca635802076dda8905
3
+ metadata.gz: 7e30d9a052af75a53c0350e6224863ecadaafd64
4
+ data.tar.gz: 7d305b139be87ba4da02e265fe956bc9908e9660
5
5
  SHA512:
6
- metadata.gz: 136bf8232bcb011c422d9190827e03b900fb87bb14a97208fe9ced758e5b04fcd5a0559f4108aa61324adda6044d79ed0978e03abf7b8351592dd69dee6fba28
7
- data.tar.gz: 71e3b3140981365520169ef362033a8e0c5b2f916061110e33f9806955bd5fac1448178d54cfc6c3679fd2a0d004207d2bfae46666381bceec783039e28ce36f
6
+ metadata.gz: 95292413c555755804bc3ec1d139080c1c96fc0019a24f1584fa1106c75ab9c3dc30c05f88b71597adcce1258180ff2585b4c6d95349a176ff9baedbee009889
7
+ data.tar.gz: fbdfc6b9fbbbe16d8b4f2f3bfce4ff648d0d31d9e33a718c74c6cf206a1ed629f460e677a6060a7659f810541624966a27aac120a962d185b0beffcfa5213c84
@@ -0,0 +1,22 @@
1
+ class Redi2casa
2
+ def hmget key, type, *column1s
3
+ if type == "counter"
4
+ table = "counters"
5
+ elsif type == "hash"
6
+ table = "hashes"
7
+ else
8
+ raise RuntimeError.new("invalid table")
9
+ end
10
+
11
+ resp = @db_conn.execute("select column1, value from #{table} where key = '#{key}' and column1 IN ('#{column1s.join("','")}')")
12
+ hash = {}
13
+ resp.each do |r|
14
+ hash[r["column1"]] = r["value"]
15
+ end
16
+ result = []
17
+ column1s.each do |column1|
18
+ result << hash[column1.to_s]
19
+ end
20
+ result
21
+ end
22
+ end
@@ -1,3 +1,3 @@
1
1
  class Redi2casa
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redi2casa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - vireshas
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-11 00:00:00.000000000 Z
12
+ date: 2013-12-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cql-rb
@@ -95,6 +95,7 @@ files:
95
95
  - lib/redi2casa/hincrby.rb
96
96
  - lib/redi2casa/hkeys.rb
97
97
  - lib/redi2casa/hlen.rb
98
+ - lib/redi2casa/hmget.rb
98
99
  - lib/redi2casa/hset.rb
99
100
  - lib/redi2casa/incrby.rb
100
101
  - lib/redi2casa/lpop.rb