From 33728ad3382d74281412d4556561d479bb88832b Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Tue, 8 Oct 2013 18:50:56 +0300 Subject: changed module paths from acf to acf2 --- acf/persistence/backends/volatile.lua | 46 ----------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 acf/persistence/backends/volatile.lua (limited to 'acf/persistence/backends/volatile.lua') diff --git a/acf/persistence/backends/volatile.lua b/acf/persistence/backends/volatile.lua deleted file mode 100644 index a83f7e3..0000000 --- a/acf/persistence/backends/volatile.lua +++ /dev/null @@ -1,46 +0,0 @@ ---[[ -Copyright (c) 2012-2013 Kaarle Ritvanen -See LICENSE file for license details ---]] - -local util = require('acf.util') - - -local backend = require('acf.object').class() - -function backend:init(data) self.data = data or {} end - -function backend:_get(path) - local res = self.data - for _, comp in ipairs(path) do - if res == nil then return end - assert(type(res) == 'table') - res = res[comp] - end - return res -end - -function backend:get(path, top) - local res = self:_get(path) - return type(res) == 'table' and util.keys(res) or res -end - -function backend:_set(path, value) - if type(value) == 'table' then value = {} end - - if #path == 0 then self.data = value - - else - local comps = util.copy(path) - local name = comps[#comps] - table.remove(comps) - self:_get(comps)[name] = value - end -end - -function backend:set(mods) - for _, mod in ipairs(mods) do self:_set(unpack(mod)) end -end - - -return backend -- cgit v1.2.3