Method: Redis::Database#expire

Defined in:
lib/redis/database.rb

#expire(key, seconds) ⇒ Object



52
53
54
55
56
57
# File 'lib/redis/database.rb', line 52

def expire key, seconds
  return false unless @dict.has_key? key
  touch key
  @expiry[key] = Time.now + seconds
  return true
end