Class: HashPipe::Backends::Memcache
- Inherits:
-
Object
- Object
- HashPipe::Backends::Memcache
- Defined in:
- lib/hashpipe/backends/memcache.rb
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(archived_attribute) ⇒ Memcache
constructor
A new instance of Memcache.
- #load ⇒ Object
- #save(content) ⇒ Object
Constructor Details
#initialize(archived_attribute) ⇒ Memcache
Returns a new instance of Memcache.
6 7 8 9 |
# File 'lib/hashpipe/backends/memcache.rb', line 6 def initialize(archived_attribute) @archived_attribute = archived_attribute @config = HashPipe::GlobalConfiguration.instance[:memcache] end |
Instance Method Details
#destroy ⇒ Object
15 16 17 |
# File 'lib/hashpipe/backends/memcache.rb', line 15 def destroy cache.delete(key_name) end |
#load ⇒ Object
19 20 21 |
# File 'lib/hashpipe/backends/memcache.rb', line 19 def load cache.read(key_name) end |
#save(content) ⇒ Object
11 12 13 |
# File 'lib/hashpipe/backends/memcache.rb', line 11 def save(content) cache.write( key_name, content ) unless content.nil? end |