Class: Redis::Store
- Inherits:
-
Redis
- Object
- Redis
- Redis::Store
show all
- Includes:
- Interface, RedisVersion, Ttl
- Defined in:
- lib/redis/store.rb,
lib/redis/store/ttl.rb,
lib/redis/store/factory.rb,
lib/redis/store/version.rb,
lib/redis/store/interface.rb,
lib/redis/store/namespace.rb,
lib/redis/store/redis_version.rb,
lib/redis/store/serialization.rb
Defined Under Namespace
Modules: Interface, Namespace, RedisVersion, Serialization, Ttl
Classes: Factory
Constant Summary
collapse
- VERSION =
'1.11.0'
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Ttl
#set, #setnx
Methods included from Interface
#get, #set, #setex, #setnx
#redis_version, #supports_redis_version?
Constructor Details
#initialize(options = {}) ⇒ Store
Returns a new instance of Store.
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/redis/store.rb', line 16
def initialize(options = {})
orig_options = options.dup
_remove_unsupported_options(options)
super(options)
unless orig_options[:marshalling].nil?
puts %(
DEPRECATED: You are passing the :marshalling option, which has been
replaced with `serializer: Marshal` to support pluggable serialization
backends. To disable serialization (much like disabling marshalling),
pass `serializer: nil` in your configuration.
The :marshalling option will be removed for redis-store 2.0.
)
end
@serializer = orig_options.key?(:serializer) ? orig_options.delete(:serializer) : Marshal
unless orig_options[:marshalling].nil?
@serializer = orig_options.delete(:marshalling) ? Marshal : nil
end
_extend_marshalling
_extend_namespace orig_options
end
|
Class Method Details
.redis_client_defined? ⇒ Boolean
5
6
7
8
9
10
|
# File 'lib/redis/store/version.rb', line 5
def self.redis_client_defined?
defined?(::RedisClient::VERSION)
end
|
Instance Method Details
#location ⇒ Object
53
54
55
56
57
58
59
60
61
|
# File 'lib/redis/store.rb', line 53
def location
if @client.path
@client.path
else
h = @client.host
h = "[#{h}]" if h.include?(":")
"#{h}:#{@client.port}"
end
end
|
#reconnect ⇒ Object
45
46
47
|
# File 'lib/redis/store.rb', line 45
def reconnect
@client.reconnect
end
|
#to_s ⇒ Object
49
50
51
|
# File 'lib/redis/store.rb', line 49
def to_s
"Redis Client connected to #{location} against DB #{@client.db}"
end
|