Class: CrossStub::Stores::Redis
- Defined in:
- lib/cross-stub/stores/redis.rb
Instance Method Summary collapse
- #current ⇒ Object
-
#initialize(connection_and_cache_id, truncate = true) ⇒ Redis
constructor
A new instance of Redis.
- #previous ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(connection_and_cache_id, truncate = true) ⇒ Redis
Returns a new instance of Redis.
5 6 7 8 9 10 11 |
# File 'lib/cross-stub/stores/redis.rb', line 5 def initialize(connection_and_cache_id, truncate = true) require 'redis' connection, @cache_id = connection_and_cache_id.split('/') host, port = connection.split(':') @redis = ::Redis.new(:host => host, :port => port.to_i) super(truncate) end |
Instance Method Details
#current ⇒ Object
13 14 15 |
# File 'lib/cross-stub/stores/redis.rb', line 13 def current @cache_id end |
#previous ⇒ Object
17 18 19 |
# File 'lib/cross-stub/stores/redis.rb', line 17 def previous "#{@cache_id}.stale" end |