Class: Redis::Store
- 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.8.2'
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Store
constructor
A new instance of Store.
- #location ⇒ Object
- #reconnect ⇒ Object
- #to_s ⇒ Object
Methods included from Ttl
Methods included from Interface
Methods included from RedisVersion
#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 |
# File 'lib/redis/store.rb', line 16 def initialize( = {}) super unless [: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 = .key?(:serializer) ? [:serializer] : Marshal unless [:marshalling].nil? @serializer = [:marshalling] ? Marshal : nil end _extend_marshalling _extend_namespace end |
Instance Method Details
#location ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/redis/store.rb', line 48 def location if @client.path @client.path else h = @client.host h = "[#{h}]" if h.include?(":") "#{h}:#{@client.port}" end end |
#reconnect ⇒ Object
40 41 42 |
# File 'lib/redis/store.rb', line 40 def reconnect @client.reconnect end |
#to_s ⇒ Object
44 45 46 |
# File 'lib/redis/store.rb', line 44 def to_s "Redis Client connected to #{location} against DB #{@client.db}" end |