Class: CrossStub::Stores::Memcache

Inherits:
Base
  • Object
show all
Defined in:
lib/cross-stub/stores/memcache.rb

Instance Method Summary collapse

Methods inherited from Base

#clear, #get, #set

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

#currentObject



12
13
14
# File 'lib/cross-stub/stores/memcache.rb', line 12

def current
  @cache_id
end

#previousObject



16
17
18
# File 'lib/cross-stub/stores/memcache.rb', line 16

def previous
  "#{@cache_id}.stale"
end