Sha256: 8e7e022287e0b41e81e3179a5261c6211e8f789d86bbfd603f1d2b57da44c416

Contents?: true

Size: 509 Bytes

Versions: 6

Compression:

Stored size: 509 Bytes

Contents

# stub to test memcache integration
class MemCache
  def initialize
    @wrapped = {}
  end

  def set(key, object, ttl = nil)
    raise 'nope!' if ttl.is_a? Hash or (ttl and not ttl.is_a? Numeric)
    @wrapped[key] = object
  end

  def get(key)
    cache_get(key)
  end

  def cache_get(key)
    stubable_cache_get(key)
  end

  def stubable_cache_get(key)
    @wrapped[key]
  end

  def [](x)
    @wrapped[x]
  end

  def clear
    @wrapped.clear
  end

  def delete(key)
    @wrapped.delete(key)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cachy-0.3.1 spec/mem_cache.rb
cachy-0.3.0 spec/mem_cache.rb
cachy-0.2.1 spec/mem_cache.rb
cachy-0.2.0 spec/mem_cache.rb
cachy-0.1.7 spec/mem_cache.rb
cachy-0.1.6 spec/mem_cache.rb