RubyRedis info postprocessor rewritten in a more functional way

This commit is contained in:
antirez 2009-05-21 13:51:30 +02:00
parent fc9aeaeaf8
commit f5bf7e3e30

View File

@ -31,8 +31,7 @@ class RedisClient
"info" => lambda{|r| "info" => lambda{|r|
info = {} info = {}
r.each_line {|kv| r.each_line {|kv|
k,v = kv.split(':', 2) k,v = kv.split(":",2).map{|x| x.chomp}
k,v = k.chomp, v = v.chomp
info[k.to_sym] = v info[k.to_sym] = v
} }
info info