Class: Suo::Client::Memcached
Constant Summary
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
- #clear ⇒ Object
-
#initialize(key, options = {}) ⇒ Memcached
constructor
A new instance of Memcached.
Methods inherited from Base
#lock, #locked?, #locks, #refresh, #unlock
Constructor Details
#initialize(key, options = {}) ⇒ Memcached
Returns a new instance of Memcached.
4 5 6 7 |
# File 'lib/suo/client/memcached.rb', line 4 def initialize(key, = {}) [:client] ||= Dalli::Client.new([:connection] || ENV["MEMCACHE_SERVERS"] || "127.0.0.1:11211") super end |
Instance Method Details
#clear ⇒ Object
9 10 11 |
# File 'lib/suo/client/memcached.rb', line 9 def clear @client.with { |client| client.delete(@key) } end |