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