lib/redis/objects/values.rb in redis-objects-1.2.1 vs lib/redis/objects/values.rb in redis-objects-1.3.0
- old
+ new
@@ -42,9 +42,18 @@
end
else
include mod
end
end
+
+ def mget(name, objects = [])
+ return [] if objects.nil? || objects.empty?
+ raise "Field name Error" if !redis_objects.keys.include?(name.to_sym)
+
+ keys = objects.map{ |obj| obj.redis_field_key name.to_sym }
+
+ self.redis.mget keys
+ end
end
# Instance methods that appear in your class when you include Redis::Objects.
module InstanceMethods
end