Class: Geomash::AutoexpireCacheRedis

Inherits:
Object
  • Object
show all
Defined in:
lib/geomash/autoexpire_cache_redis.rb

Instance Method Summary collapse

Constructor Details

#initialize(store, ttl = 86400) ⇒ AutoexpireCacheRedis

Returns a new instance of AutoexpireCacheRedis.


4
5
6
7
# File 'lib/geomash/autoexpire_cache_redis.rb', line 4

def initialize(store, ttl = 86400)
  @store = store
  @ttl = ttl
end

Instance Method Details

#[](url) ⇒ Object


9
10
11
# File 'lib/geomash/autoexpire_cache_redis.rb', line 9

def [](url)
  @store.[](url)
end

#[]=(url, value) ⇒ Object


13
14
15
16
# File 'lib/geomash/autoexpire_cache_redis.rb', line 13

def []=(url, value)
  @store.[]=(url, value)
  @store.expire(url, @ttl)
end

#del(url) ⇒ Object


22
23
24
# File 'lib/geomash/autoexpire_cache_redis.rb', line 22

def del(url)
  @store.del(url)
end

#keysObject


18
19
20
# File 'lib/geomash/autoexpire_cache_redis.rb', line 18

def keys
  @store.keys
end