Class: Kvom::Storage::CacheWithPrefix

Inherits:
Object
  • Object
show all
Defined in:
lib/kvom/storage/cache_with_prefix.rb

Instance Method Summary collapse

Constructor Details

#initialize(cache, prefix) ⇒ CacheWithPrefix

Returns a new instance of CacheWithPrefix.



7
8
9
10
# File 'lib/kvom/storage/cache_with_prefix.rb', line 7

def initialize(cache, prefix)
  @prefix = prefix
  @cache = cache
end

Instance Method Details

#read(id) ⇒ Object



12
13
14
# File 'lib/kvom/storage/cache_with_prefix.rb', line 12

def read(id)
  cache.read(cache_id(id))
end

#write(id, value) ⇒ Object



16
17
18
# File 'lib/kvom/storage/cache_with_prefix.rb', line 16

def write(id, value)
  cache.write(cache_id(id), value)
end