Method: Shrinker::Backend::Redis#store
- Defined in:
- lib/shrinker/backend/redis.rb
#store(raw_url, token, attributes = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/shrinker/backend/redis.rb', line 13 def store(raw_url, token, attributes = {}) content = Shrinker::Serializer::to_json(raw_url, attributes) redis_key = key(token) if ttl client.setex(redis_key, ttl, content) else client.set(redis_key, content) end end |