Module: UrlResolver::CacheImplementations::RedisCache

Defined in:
lib/url_resolver/cache_implementations/redis.rb

Instance Method Summary collapse

Instance Method Details

#cache_key(url) ⇒ Object



12
13
14
# File 'lib/url_resolver/cache_implementations/redis.rb', line 12

def cache_key(url)
  "url_resolver.urls.#{url}"
end

#get_url(url) ⇒ Object



8
9
10
# File 'lib/url_resolver/cache_implementations/redis.rb', line 8

def get_url(url)
  @cache.get(url)
end

#set_url(url, destination, ttl = 86400) ⇒ Object



4
5
6
# File 'lib/url_resolver/cache_implementations/redis.rb', line 4

def set_url(url, destination, ttl = 86400)
  @cache.setex(url, ttl, destination)
end