Commit 8eeb68d7 authored by Rajko Albrecht's avatar Rajko Albrecht

Code beauty

parent 56b1e7a2
......@@ -37,7 +37,7 @@ class Redis
ires = multi do |multi|
multi.set(key,value,ttl.nil? ? {} : {:expire_after => ttl})
end
return_value ires
ires.is_a?(Array) && ires[0] == 'OK'
end
end
......@@ -88,16 +88,12 @@ class Redis
options = extract_options keys
keys = keys.select {|k| exists(k)}
return {} if keys.empty?
values = mget(*(keys+[options]))
values = mget(*keys,options)
values.nil? ? {} : Hash[keys.zip(values)]
end
private
def return_value result
result.is_a?(Array) && result[0] == 'OK'
end
def extract_options array
if array.last.is_a?(Hash) && array.last.instance_of?(Hash)
array.pop
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment