lib/redis/objects/hashes.rb in redis-objects-0.4.1 vs lib/redis/objects/hashes.rb in redis-objects-0.5.0

- old
+ new

@@ -1,8 +1,8 @@ # This is the class loader, for use as "include Redis::Objects::Hashes" # For the object itself, see "Redis::Hash" -require 'redis/hash' +require 'redis/hash_key' class Redis module Objects module Hashes def self.included(klass) klass.send :include, InstanceMethods @@ -17,21 +17,21 @@ @redis_objects[name.to_sym] = options.merge(:type => :dict) klass_name = '::' + self.name if options[:global] instance_eval <<-EndMethods def #{name} - @#{name} ||= Redis::Hash.new(redis_field_key(:#{name}), #{klass_name}.redis, #{klass_name}.redis_objects[:#{name}]) + @#{name} ||= Redis::HashKey.new(redis_field_key(:#{name}), #{klass_name}.redis, #{klass_name}.redis_objects[:#{name}]) end EndMethods class_eval <<-EndMethods def #{name} self.class.#{name} end EndMethods else class_eval <<-EndMethods def #{name} - @#{name} ||= Redis::Hash.new(redis_field_key(:#{name}), #{klass_name}.redis, #{klass_name}.redis_objects[:#{name}]) + @#{name} ||= Redis::HashKey.new(redis_field_key(:#{name}), #{klass_name}.redis, #{klass_name}.redis_objects[:#{name}]) end EndMethods end end end