lib/trocla/stores/memory.rb in trocla-0.3.0 vs lib/trocla/stores/memory.rb in trocla-0.4.0
- old
+ new
@@ -17,9 +17,18 @@
def set(key,format,value,options={})
super(key,format,value,options)
set_expires(key,options['expires'])
end
+ def formats(key)
+ memory[key].empty? ? nil : memory[key].keys
+ end
+
+ def search(key)
+ r = memory.keys.grep(/#{key}/)
+ r.empty? ? nil : r
+ end
+
private
def set_plain(key,value,options)
memory[key] = { 'plain' => value }
end