Class: Swarm::Storage::RedisStorage
Instance Attribute Summary
#store
Instance Method Summary
collapse
#[], #[]=, #deserialize, #initialize, #regex_for_type, #serialize
Instance Method Details
#delete(key) ⇒ Object
11
12
13
|
# File 'lib/swarm/storage/redis_storage.rb', line 11
def delete(key)
store.del(key)
end
|
#ids_for_type(type) ⇒ Object
7
8
9
|
# File 'lib/swarm/storage/redis_storage.rb', line 7
def ids_for_type(type)
store.keys("#{type}:*").map { |key| key.gsub(regex_for_type(type), '\1') }
end
|
#truncate ⇒ Object
15
16
17
|
# File 'lib/swarm/storage/redis_storage.rb', line 15
def truncate
store.flushdb
end
|