Class: RedExpire

Inherits:
Red
  • Object
show all
Defined in:
lib/redness/red_expire.rb

Class Method Summary collapse

Methods inherited from Red

client_version, delete, #execute_with_uncertainty, #method_missing, #multi_with_caution, #redis

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Red

Class Method Details

.redisObject



2
3
4
# File 'lib/redness/red_expire.rb', line 2

def self.redis
  @redis ||= Red.new
end

.set(key, expires_in) ⇒ Object



6
7
8
9
10
# File 'lib/redness/red_expire.rb', line 6

def self.set(key, expires_in)
  redis.execute_with_uncertainty(nil) do
    redis.expire(key, expires_in.seconds.to_i)
  end
end