Support passing a list of pairs to HMSET. #56

merged 2 commits into from Mar 20, 2013


None yet
2 participants

jeffday commented Mar 19, 2013

invoking hmset("key", [:k1, "val1"], [:k2, "val2"]) is supported in redis-rb, so i've implemented that behavior here.

@caius caius commented on an outdated diff Mar 20, 2013

data_type_check(key, Hash)
data[key] ||= {}
- fields.each_slice(2) do |field|
- data[key][field[0].to_s] = field[1].to_s
+ if (is_list_of_arrays)

caius Mar 20, 2013


FYI general convention in ruby is to skip the parens in if statement conditions. Could you possibly tidy this up to remove them please? 😄


caius commented Mar 20, 2013

This is awesome - many many thanks for this PR. Spotted one little style thing, if you could please amend that I'll be more than happy to merge this.

Again, many thanks!

@caius caius added a commit that referenced this pull request Mar 20, 2013

@caius caius Merge pull request #56 from jeffday/hmset_list_of_pairs
Support passing a list of pairs to HMSET.

@caius caius merged commit 3919d96 into guilleiguaran:master Mar 20, 2013

1 check was pending

default The Travis build is in progress

caius commented Mar 20, 2013

Merged. Thanks @jeffday!

jeffday deleted the jeffday:hmset_list_of_pairs branch Mar 20, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment