Class: Verdict::Storage::RedisStorage
- Inherits:
-
BaseStorage
- Object
- BaseStorage
- Verdict::Storage::RedisStorage
- Defined in:
- lib/verdict/storage/redis_storage.rb
Defined Under Namespace
Classes: ConnectionPoolLike
Constant Summary collapse
- PAGE_SIZE =
50
Instance Attribute Summary collapse
-
#key_prefix ⇒ Object
Returns the value of attribute key_prefix.
-
#redis ⇒ Object
Returns the value of attribute redis.
Instance Method Summary collapse
-
#initialize(redis = nil, options = {}) ⇒ RedisStorage
constructor
A new instance of RedisStorage.
Methods inherited from BaseStorage
#cleanup, #remove_assignment, #retrieve_assignment, #retrieve_start_timestamp, #store_assignment, #store_start_timestamp
Constructor Details
#initialize(redis = nil, options = {}) ⇒ RedisStorage
Returns a new instance of RedisStorage.
8 9 10 11 12 13 14 15 16 |
# File 'lib/verdict/storage/redis_storage.rb', line 8 def initialize(redis = nil, = {}) if !redis.nil? && !redis.respond_to?(:with) @redis = ConnectionPoolLike.new(redis) else @redis = redis end @key_prefix = [:key_prefix] || 'experiments/' end |
Instance Attribute Details
#key_prefix ⇒ Object
Returns the value of attribute key_prefix.
6 7 8 |
# File 'lib/verdict/storage/redis_storage.rb', line 6 def key_prefix @key_prefix end |
#redis ⇒ Object
Returns the value of attribute redis.
6 7 8 |
# File 'lib/verdict/storage/redis_storage.rb', line 6 def redis @redis end |