Class: Flop::Repository::Redis
- Inherits:
- 
      Object
      
        - Object
- Flop::Repository::Redis
 
- Defined in:
- lib/flop/repository/redis.rb
Instance Method Summary collapse
- #get(name) ⇒ Object
- 
  
    
      #initialize(redis, namespace = '')  ⇒ Redis 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Redis. 
- #set(name, value) ⇒ Object
Constructor Details
#initialize(redis, namespace = '') ⇒ Redis
Returns a new instance of Redis.
| 4 5 6 7 | # File 'lib/flop/repository/redis.rb', line 4 def initialize(redis, namespace = '') @redis = redis @namespace = namespace end | 
Instance Method Details
#get(name) ⇒ Object
| 9 10 11 | # File 'lib/flop/repository/redis.rb', line 9 def get(name) @redis.get(key(name)).to_i == 1 end | 
#set(name, value) ⇒ Object
| 13 14 15 | # File 'lib/flop/repository/redis.rb', line 13 def set(name, value) @redis.set(key(name), value ? 1 : 0) end |