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 = {}
r.each_line {|kv|
k,v = kv.split(':', 2)
k,v = k.chomp, v = v.chomp
k,v = kv.split(":",2).map{|x| x.chomp}
info[k.to_sym] = v
}
info