class LocalFileStoreApp class AppFileStore # writeDelay in seconds, default is 30 seconds def initialize(store,appClass,instanceName) @store=store @appClass=appClass @instanceName=instanceName end def []=(name,value) save(name,value) end def [](name) load(name) end def rm(name) @store.getApp(:permaspace).rm(id(name)) end private def save(name,value) @store.getApp(:permaspace).store(id(name),value) end def load(name) @store.getApp(:permaspace).load(id(name)) end def id(name) "AFS_#{@appClass}_#{@instanceName}_#{name}".gsub(/[^a-zA-Z0-9_]/,'') end end end