lib/picky/internals/index/redis/basic.rb in picky-2.0.0.pre2 vs lib/picky/internals/index/redis/basic.rb in picky-2.0.0.pre3
- old
+ new
@@ -1,65 +1,65 @@
module Internals
module Index
-
+
class Redis
-
+
# Redis Backend Accessor.
#
# Provides necessary helper methods for its
# subclasses.
# Not directly useable, as it does not provide
# dump/load methods.
#
class Basic
-
+
attr_reader :namespace, :backend
-
+
# An index cache takes a path, without file extension,
# which will be provided by the subclasses.
#
def initialize namespace
@namespace = namespace
-
+
# TODO Turn this inside out such that people can pass in
# their own Redis instance.
- #
+ #
# TODO Make the :db a real option.
#
@backend = ::Redis.new :db => 15
end
-
+
# Does nothing.
#
def load
# Nothing.
end
# We do not use Redis to retrieve data.
#
def retrieve
# Nothing.
end
-
+
# Redis does not backup.
#
def backup
# Nothing.
end
-
+
# Deletes the Redis index namespace.
#
def delete
# Not implemented here.
# Note: backend.flushdb might be the way to go,
# but since we cannot delete by key pattern,
# we don't do anything.
end
-
+
# Checks.
#
-
+
# Is this cache suspiciously small?
#
def cache_small?
size < 1
end
@@ -77,13 +77,13 @@
# DBSIZE KEYPATTERN, we are stuck with this.
#
def size
backend.dbsize
end
-
+
end
-
+
end
-
+
end
-
+
end
\ No newline at end of file