How about putting everything in JSON? `redis.set(key, MultiJson.dump(:selector => ..., :class => ...)`