Class: Suo::Client::Redis

Inherits:
Base
  • Object
show all
Defined in:
lib/suo/client/redis.rb

Constant Summary collapse

OK_STR =
"OK".freeze

Constants inherited from Base

Base::BLANK_STR, Base::DEFAULT_OPTIONS

Instance Attribute Summary

Attributes inherited from Base

#client, #key, #options, #resources

Instance Method Summary collapse

Methods inherited from Base

#lock, #locked?, #locks, #refresh, #unlock

Constructor Details

#initialize(key, options = {}) ⇒ Redis

Returns a new instance of Redis.



6
7
8
9
# File 'lib/suo/client/redis.rb', line 6

def initialize(key, options = {})
  options[:client] ||= ::Redis.new(options[:connection] || {})
  super
end

Instance Method Details

#clearObject



11
12
13
# File 'lib/suo/client/redis.rb', line 11

def clear
  with { |r| r.del(@key) }
end