Class: HashPipe::Backends::Memcache

Inherits:
Object
  • Object
show all
Defined in:
lib/hashpipe/backends/memcache.rb

Instance Method Summary collapse

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

#destroyObject



15
16
17
# File 'lib/hashpipe/backends/memcache.rb', line 15

def destroy
  cache.delete(key_name)
end

#loadObject



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